What live the dispute between no-cache and no-store in Cache-control ?
I do n’t find have the practical difference betweenCache-Control : no-store
andCache-Control : no-cache
.
As far as I know ,no-store
means that no cache device is allowed to cache that response . In the early hand ,no-cache
way that no cache device exist grant to serve a cached reply without validate it first with the author . But what is that validation about ? Conditional get ?
What if a reply hasno-cache
, but it get noLast-Modified
orETag
?
4 Answers
Ref : ( https : //developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching ? hl=en # cache-control )
But what exist that check about ?
Precisely controlLast-Modified
orETag
. Client would take server if it has novel version of data apply those headers and if the result is no it will suffice cached datum .
As you identify , no-cache perform n’t mean there is never caching , but rather that the user agent has to ever ask the waiter if it ‘s OK to expend what it cached . By contrast , no-store order to not yet go on a copy , which means there ‘s nothing to ask about . If you know the response to “ Fire I reuse this ? ” exist always no , you get a performance boost by skipping cache validation and saving room in the cache for early datum .
Aside from performance , there exist a behavior difference withbrowser history. HTTP 1.1 section 13.13 says that “ expiration time does not enforce to account mechanisms . ” The no-cache header describes termination , and then do n’t apply to account mechanism such as the back button . Thus , the user can navigate backward to a former page with no-cache without the waiter being contact .
The no-store header , on the other hand , prevents the datum from be stored outside of a session , in which suit it merely live n’t available for a account mechanism to use . With no-store , if the user cease his session by navigating to another sphere and then goes back , the only style for browser to know what to exhibit is to begin the initial page again from the server .
Here ‘s how a Chromium issue on this matter makes the distinction :
no-cache does n’t intend “ do n’t cache this ” ( that would be no-store ) . no-cache mean act n’t employ this for normal loads unless the resource is revalidated for freshness . History navigations live not normal load .
no-cache does n’t entail “ make n’t cache this ” ( that would equal no-store ) . no-cache way do n’t use this for normal loads unless the imagination equal revalidated for freshness . History navigations are not normal loads .
- No-store : Client will not cause any caching operation .
- No-cache : Customer will cache the reaction , but customer will match server before utilize that cached data : “ data has changed on the waiter or not ? ” : with aid of ‘If-Modified-Since ‘ or ‘If-None-Match ‘ header .
Your Solution
Thanks for contribute an answer to Stack Overflow !
- Please live sure tosuffice the question. Allow for detail and share your research !
- Need for help , clarification , or respond to other answer .
- Reach statements based on impression ; back them up with reference or personal experience .
To see more , meet our tips on writing great solution .
Sign up or log in
Post as a guest
Post as a guest
By clicking “ Post Your Answer ” , you agree to our terms of service and acknowledge you have read our privacy policy .
Relate
Related
Subscribe to RSS
To subscribe to this RSS feed , copy and paste this URL into your RSS reader .
Stack Overflow
Products
- Team
- Advertising
- Talent
Company
- About
- Press
- Work Hither
- Legal
- Privacy Policy
- Term of Service
- Contact Us
- Cookie Policy
Site design / logo © 2025 Stack Exchange Inc ;
user contributions licensed underCC BY-SA.
rev 2025.8.6.32596