Welcome! Log In Create A New Profile

Advanced

add header Expires and Cache-Control when response is 404

February 09, 2011 09:19AM
Hello,
I need to add header Expires, when the response code is 404. Unfortunately HttpHeadersModule can set the header just when the response is 200, 204, 301, 302 or 304. It's no problem to add the header using HttpHeadersMoreModule even if the status is 404. But It is written in description of HeadersMoreModule:
"Unlike the standard headers module, this module does not automatically take care of the constraint among the Expires, Cache-Control, and Last-Modified headers. You have to get them right yourself or use the headers module together with this module."
How can it be done using both modules together? Or another idea? Or, how can I get time that would represent: now + 24h and then add this value to the header using more_set_headers directive?
more_set_headers 'Expires: $time_now_plus_24h'

Thank in advance,
Michal
Subject Author Posted

add header Expires and Cache-Control when response is 404

michalkraus February 09, 2011 09:19AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 45
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready