How to unset Cache-Control max-age in .htaccess?
I'm trying to unset Cache-Control's max-age via .htaccess. The following removes Cache-Control entirely:
Header unset Cache-Control
How do I tell it to remove j开发者_如何学Pythonust "max-age?" Thanks.
In Apache 2.2.4 there is a new Header edit action that allows you to do exactly these kind of manipulations.
From the Apache documentation: If this request header exists, its value is transformed according to a regular expression search-and-replace. The value argument is a regular expression, and the replacement is a replacement string, which may contain backreferences.
However, the regex needed would be fairly complicated. Hence I suggest to just use Header set to override the current Cache-Control if you can hardcode the value. Using the set action overrides the previous value containing max-age.
精彩评论