Answer the question
In order to leave comments, you need to log in
Am I using the Cache-Control header correctly?
The caching scheme is as follows: a certain resource should be cached at the request of the browser, but at the same time, with each new page opening, it should be revalidated on the server and receive a 200 or 304 header (depending on the presence in the cache). Also, every 10 minutes it twitches in the background via XMLHttpRequest and is updated on the page in order to avoid open god knows when tabs are open.
Is a simple header sufficient for this purpose:
Cache-Control: no-cache
?
No need to additionally add directives like max-age or must-revalidate there, separated by commas? As the documentation
says :
no-cache
The response may be stored by any cache, even if the response is normally non-cacheable. However, the stored response MUST always go through validation with the origin server first before using it, therefore, you cannot use no-cache in-conjunction with immutable. If you mean to not store the response in any cache, use no-store instead. This directive is not effective in preventing caches from storing your response.
Cache-Control: private, no-cache
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question