httpcachinghttp-caching

What is the difference between no-cache and no-store in Cache-control?


I don't find get the practical difference between Cache-Control:no-store and Cache-Control:no-cache.

As far as I know, no-store means that no cache device is allowed to cache that response. In the other hand, no-cache means that no cache device is allowed to serve a cached response without validate it first with the source. But what is that validation about? Conditional get?

What if a response has no-cache, but it has no Last-Modified or ETag?

Regards.


Solution

  • But what is that check about?

    Exactly checking Last-Modified or ETag. Client would ask server if it has new version of data using those headers and if the answer is no it will serve cached data.


    Update

    From RFC

    no-cache
        If the no-cache directive does not specify a field-name, then a cache MUST NOT use
     the response to satisfy a subsequent request without successful revalidation with the
     origin server. This allows an origin server to prevent caching even by caches that   
     have been configured to return stale responses to client requests.