.htaccess: how to remove Cache-Control’s “max-age”

.htaccessapache-2.2

In the header response, I want to remove Cache-Control's "max-age"? I don't want to completely unset Cache-Control, though — just want to get rid of max-age. So the following would be wrong:

Header unset Cache-Control

I think there is a way to do this using "edit" instead of "unset". However, I'm not sure how to use "edit".

Suggestions?

Best Answer

You can do something like:

Header edit Cache-Control ^(.*)max-age=(\d+)(.*)$ \1\3

This should remove the 'max-age= from the Cache-Control header.

Related Topic