content-refresh

Invalidate CDN cache at an explicit date/time. Epoch timestamp in GMT as the explicit moment after which new requests must be served a revalidated or new copy of the object.

The "type" parameter (required) defines the Edge server behavior. There are four possible settings for the "type":

  • epoch – The "value" supplied should be a valid epoch in seconds in the future. Epoch time is an integer that is the number of seconds since January 1, 1970 as calculated by the Unix system. Example: 1388534400
  • date-time – The "value" supplied should be an ISO 8601 future time string in GMT (e.g. – "YYYY-MMDDThh:mm:ssZ"; for example: "2014-01-01T12:00:00Z").
  • date – The "value" supplied should be an ISO 8601 future date string in GMT (e.g. – "YYYYMM-DD"; for example: "2014-01-01") where the invalidation occurs at midnight GMT on the specified date.
  • natural – Invalidate the content immediately upon publication of the policy. The value should be "now".

The following params are supported.

  • mustRevalidate – Specify true or false.
    • true – The edge server must not serve content from cache if it has not been revalidated after the given invalidation time.
    • false – The edge server may serve content from cache if an attempt to revalidate the content fails to receive a response from the origin server.

Note that the origin server might return a 304 for content that is replaced with an object whose "Last-Modified" is less than or equal to the original timestamp seen in the "If-Modified-Since" conditional request header. In such cases, if the origin server returns a 304 HTTP status code, then the Edge server will serve the cached entry as it will have successfully "revalidated" the object via the origin. It is necessary to execute the Purge a cached asset API to purge cached objects completely.

In this example, the site owner wishes to publish a new version of their software application on Wednesday, January 1, 2014 at 00:00:00 GMT (epoch time "1388534400"). All cached URLs in the "/app/download/currentversion/*" path should be invalidated after midnight so that links to the most current version(s) will be displayed to end users.


       {
         "rules": [
           {
             "matches": [
               {
                 "name": "url-wildcard",
                 "value": "/app/download/currentversion/*"
               }
             ],
             "behaviors": [
               {
                 "name": "content-refresh",
                 "type": "epoch",
                 "value": "1388534400",
                 "params": {
                   "mustRevalidate" : true
                 }
               }
             ]
           }
         ]
       }
     

Note that the links to new content should not be made available for download at the origin until the time indicated to avoid polluting cache with a mix of old and new objects.