Question

This page says this:

If a response includes both an Expires header and a max-age directive, the max-age directive overrides the Expires header, even if the Expires header is more restrictive

It seems like both of the mod_expires and mod_headers are active in my server.
Which of them is preferable and can you comment the advantages of each of them?
Thank you.

Was it helpful?

Solution

You probably just want to use mod_expires, as this allow for sending of both Cache-Control header and Expires headers automatically and can allow you to specify by both access time and file modification time. It also allows you to set different defaults by file type.

Using mod_expires you could set the default expiry using the following directive:

ExpiresDefault "access plus 2 days"

Of course mod_headers is a much more general module that allows you to do some of the same stuff, but generally used more for creating custom headers or manage multiple (possibly conflicting) headers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top