How to control the way my site is cached

Created at:
Avatar
Updated

Set caching mode:

Caching mode settings let you configure overall caching policy for a website.

Caching Mode

Description

Disable Caching

No caching is performed and all requested content is retrieved from your origin web server.

Static Only

Only content that was marked by the site's developer / web server as static using standard HTTP headers is cached.

Static + Dynamic

In addition to content that was marked by the site's developer / web server as static using standard HTTP headers, Incapsula also profiles other resource to identify and cache static content that was not marked as so. The time period (in minutes, hours, days or weeks) that you set for this option determines how often the cache is refreshed.

Note: This option does not cache personalized or dynamic content.

Aggressive

All site content is cached. The time period (in minutes, hours, days or weeks) that you set for this option determines how often the cache is refreshed (TTL).

 

The following headers must be set to indicate what resources can be cached by Incapsula and for what period of time. (These are standard HTTP headers, as defined in this W3 Protocol):

+ Max-age - if you wish for Incapsula to avoid caching a page, set it to 0 on that page. If you wish to have the items in the page cached, set it to a higher number (such as 3600).
Cache-Control  - if it's set to no-cache / private / must-revalidate / proxy-revalidate/ no-store – then it'll prevent caching by Incapsula, unless site Acceleration Mode is set to Aggressive.
+ Last-Modified – If the value is in the distant past, Incapsula instantly assumes it can be cached.
+ Vary – If it's set to anything other than "Accept-Encoding" the resource will not be cached, assuming different content (for example: for different client types or different client languages).

 

Please note that Incapsula will only display RFC compliant headers.

Non-Compliant Format example:    Last-Modified: Wednesday, 08-Mar-2017 12:39:13 GMT 

 Compliant Format:                            Expires: Wed, 08 Mar 2017 12:46:13 GMT

 

Caching HTTPS traffic:

When Incapsula caching mode is set to Static + Dynamic, the default caching behavior for HTTPS is as follows:

  • Only the following resources may be cached heuristically: images,css

    files, JavaScript files, and resources defined with the Cache-Control: public header.

  • Resources that include explicit caching directives against caching, as defined in the resources themselves using the Cache-Control or Expires HTTP headers, are not cached.

  • HTML files are not cached.

  • Asynchronous validation is not used.

 

Important note: 

The way to force cache purge on a specific page, is to use "Ctrl+F5" (depending on browser) as it is intended to abandon all cached content and just retrieve all content from the servers again.

In order to refresh all of the site's cached content you can turn the Acceleration Mode under Settings to Off, and then after 5 minutes turn it to On again.

 

For additional information:

Caching Settings

Proprietary Dynamic Content Caching solution

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk