The must-revalidate response directive indicates that the response can be stored in caches and can be reused while fresh. Once it becomes stale, it must be validated with the origin server before reuse. Typically, must-revalidate is used with max-age .

When to use must-revalidate?

The must-revalidate directive ought to be used by servers if and only if failure to validate a request on the representation could result in incorrect operation, such as a silently unexecuted financial transaction.

How does Cache-Control work?

Cache-Control is a HTTP cache header that contains a set of parameters to define the browser’s caching policies in the client requests and server responses. When a client makes a request to the server, the browser can cache, or store copies of resources for faster access and lower latency.

How long does browser cache last?

If a user stops using the browser it is indefinitely. If he/she uses the browser rarely, it will be until the expiration – either by internal policy or by HTTP headers. If he/she uses the browser heavily, it can be 12 minutes or even less.

What is Cache-Control no-cache?

Cache-Control: No-Cache The no-cache directive means that a browser may cache a response, but must first submit a validation request to an origin server.

What is default Cache-Control?

The default cache-control header is : Private. A cache mechanism may cache this page in a private cache and resend it only to a single client. This is the default value. Most proxy servers will not cache pages with this setting.

What is Cache-Control no cache?

What is stale while revalidate?

The stale-while-revalidate attribute is used by the Cache-Control header and defines an extra window of time during which a cache (proxy, user agents) can use a stale asset while it revalidates it asynchronously. This improves subsequent page load latencies as stale assets are non longer in the critical path.

How do I know if cache is working?

How to find out if your website cache is working correctly?

  1. A quick way of to test if your caching is enabled and working correctly on your website is by using the Cache Checker tool:
  2. If you use the Cache Checker tool, you will also receive the cache header response.

What is the difference between must-revalidate and no-cache cases?

In the must-revalidate case the client is allowed to send a If-Modified-Since request and serve the response from cache if 304 Not Modified is returned. In the no-cache case, the client must not cache the response, so should not use If-Modified-Since.

What is caching in RESTful Web Services?

RESTful Web Services – Caching. Caching refers to storing the server response in the client itself, so that a client need not make a server request for the same resource again and again.

What is the use of must-revalidate in a response type?

This can be enormously useful in balancing strong consistency with reducing bandwidth and latency. must-revalidate: indicates a normally uncacheable response is cacheable, but requires a cache to revalidate stale responses before using a cached response.

What does cache-control ‘Max-Age=3600’ mean?

Cache-Control “max-age=3600, must-revalidate” it is telling both client caches and proxy caches that once the content is stale (older than 3600 seconds) they must revalidate at the origin server before they can serve the content.