Modules

filter

 

Objects/Functions

module (N/cache)

SuiteScript 2.0

Cache.put(options)

{Cache}.put({key: {string*},value: {string*},ttl: {number}})

N/cache Module
Cache.put()
Method Description: Puts a value into the cache. You can also put a value in a cache by using the Cache.get(options) method and the options.loader parameter. In general, using the get method is recommended and may result in a more efficient design. For an example, see N/cache Module Script Sample
Returns: void
Supported Script Types: All server-side scripts For additional information, see SuiteScript 2.0 Script Types.
Governance: 1 unit
Module: N/cache Module
Parent Object: cache.Cache
Sibling Object Members: Cache Object Members
Since: 2016.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Cache.put(options)

Example:

// Code Example 1
//Add additional code
//...
var myCache = cache.getCache({
name: 'temporaryCache',
scope: cache.Scope.PRIVATE
});
myCache.put({
key: 'keyText',
value: 'valueText',
ttl: 300
});
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4642661313.html