What'll happen if I set server response as:
Cache-Control: private,no-cache,max-age=900
?
What'll happen if the header is like:
Cache-Control: public,no-cache,max-age=900
?
Since it has a no-cache
whether browser (Or proxy server) consider the max-age
?
As stated in the RFC documents:
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.
As a result, if no-cache
has been defined in a server's response, this means that the browser (and any intermediary caches) will "revalidate" on every request (aka make a request to the origin server and return its response, instead of using any cached content).
So, to clearly answer your question:
Since it has a no-cache whether browser (Or proxy server) consider the
max-age?
No, the browser will not consider the max-age
(given that the browser can handle the no-cache
directive, since this might not recognized by some HTTP 1.0 browsers/caches).