Expire Header and Cache-Control

This article highlights the differences and characteristics of the directives Expire, Max Expire and Ignore Cache Control. These parameters allow you to customize the cache behaviour on the edge servers. Max Expire and Ignore Cache Control are only relevant for Pull Zones.

Cache-Control: Edge Server to Client relevant directives

Expire

The parameter Expire adds or modifies the Expires and Cache-Control response header fields that are sent to the client if the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. This setting overwrites the value received from the origin in case of a Pull Zone. The Expire value has only an impact on the web browser cache and not on the KeyCDN cache. It is crucial to understand that this directive is only relevant between the edge server and the client.

The following cases apply to this parameter if it has these values:

-1
Cache-Control: no-cache
0
Push Zone: disabled
Pull Zone: as received from the origin (header honoring)
>0
Cache-Control: max-age=t, where t is the time specified in the directive in minutes converted to seconds

Example with Expire set to 1440 (value in minutes which equals to 1 day):

The max-age value reflects the Expire directive in seconds (86400sec = 1440min).

Cache-Control: Origin Server to Edge Server relevant directives

Max Expire

The directive Max Expire specifies the maximum time for which cacheable HTTP data will be retained on KeyCDN’s edge servers without checking the origin server. Applies only if NOT defined by the origin either by X-Accel-Expires, Cache-Control or Expires (precedence in that order).

Ignore Cache Control

Ignore Cache Control allows to disables processing of Cache-Control response header fields (Ignore Cache Control) from the origin server (ignores X-Accel-Expires, Cache-Control and Expires). It is important to note that Max Expires has precedence if Ignore Cache Control is enabled.

More details about HTTP cache-control header fields could be found in the RFC 2616.

Related Articles

Expire Header and Cache-Control was last modified: June 5th, 2017 by Sven Baumgartner
Share This