ServerResponse.setCdnCacheable(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Sets CDN caching for a period of time.

Returns

void

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/http Module

Parent Object

http.ServerResponse

Sibling Object Members

ServerResponse Object Members

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.type

enum

required

The value of the caching duration. Use http.CacheDuration to set this value.

When used with a Suitelet, if this value is set to UNIQUE, then the Suitelet will never be cached and will always be executed if there's a request to its URL.

2015.2

Errors

Error Code

Message

Thrown If

SSS_MISSING_REQD_ARGUMENT

Missing a required argument: {param name}

The options.type parameter is not specified.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, se N/http Module Script Samples.

          // Add additional code 
...
serverResponse.setCdnCacheable({
    type: http.CacheDuration.MAX
});
...
// Add additional code 

        

Related Topics

http.ServerResponse
N/http Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices