Cache Control Header Values

For more detailed explanations you may visit HTTP Caching.

Cache-Control Header Values

Explanation

no-store This content can not be stored. All the requests are responded by the origin.
no-cache This content can be stored but can not be served without revalidation
private Private value bypasses the shared cache. This content can only be stored in the user’s browser cache.
public Public value allows caching in all the layers. If there is no indication (no-cache, no-store, private or public) this value is assumed as public.
max-age=<time_in_seconds> This value can be used with private and public values to indicate the cache time.
s-max-age=<time_in_seconds> It indicates the time for shared caches. It can be used with max-age to differ the cache time browser and shared cache.
must-revalidate This value applies when a cache is expired. If the must-revalidate value is assigned the content can not be served before validation.
proxy-revalidate

This value applies when a cache is expired.

It applies the validation for only shared caches.

no-transform It forbids any changes to the response (such as minimizing data for storing and slow connection concerns)  and headers Content-Encoding, Content-Range, or Content-Type.
stale-while-revalidate=<time_in_seconds>

This value applies when a cache is expired. Client will receive a stale cache while content is being validated in the background. Time value indicates how long the stale cache will served.

stale-if-error=<time_in_seconds> This value applies when a cache is expired.  If an error occurs while the content is being validated, the stale cache will be served to the client. Time value indicates how long the stale cache will be served.

 

Pragma Header Values

Explanation

no-cache

This content can be stored but can not be served without revalidation. For all the requests a revalidation request is sent to the origin.

Pragma does not have the same functionality as the Cache-control so it must be used only for back compatibility.

 

E-Tag Header Values

Explanation

<EtagValue> 

Strong Etag: the content matches byte by byte

<W/EtagValue>

Weak Etag: there can be differences in the content in the byte range

 

Last Modified

Explanation

<Date_in_GMT> It indicates the date the content is changed

 

Age

Explanation

<Time_in_seconds> It indicates the time that content is stored in the cache in seconds

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.