Is it possible to use the expires directive in nginx to display the “Expires” header alone without the Cache-control ?
Also I’ve seen some websites whose max-age value decrements over time.
After 10 mins changes to
How is this done ? Are there any advantages of doing this ?
Thanks for the reply.
I meant the expires directive of nginx. When I use it in my config it adds both the
Expires header and
Cache-Control: max-age header.
So how do I make it add only the
Expires header ?
Yes, you can use
Cache-Control. However, if
Cache-Control: max-age is present, it overrides
Expires. See RFC 2616 section 14.21.
There is no reason to not have both headers. Some broken clients may only check one or the other.
As to the question of what
max-age should be set to, this is entirely up to you.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.