6

I'm using an IIS website with a Apache HTTP reverse proxy (mod_proxy with ProxyRequests Off). I want to control the expires headers in apache (don't ask), but IIS is setting the header Expires: -1.

This causes mod_expires to ignore the request since it already has a value.

I tried the solutions in https://stackoverflow.com/questions/7930140/overwrite-cache-headers-with-mod-expires, but it doesn't work (the early trick doesn't work).

How do I disable IIS to specify Expires: -1 ?

OR

How do I force mod_expires to override it (since I'm using apache as a reverse proxy, I should be able to do this!)

5
  • What version of IIS? If you have a web.config, your expires should be in there and can be deleted there or from the GUI. May 21, 2013 at 1:49
  • The question was about how to configure apache to override these -1 (the title and tags were badly chosen). The problem we had were cookies being set, so that made IIS set Expires header. We fixed that using javascript cookie istead of server side cookie. That solved it... Still no answer to how to convince mod_expires to override -1
    – Jaap
    May 21, 2013 at 22:28
  • Theoretically, Expires is just another http header. If you have the capability to delete headers in Apache, that might do the trick. May 22, 2013 at 18:27
  • See httpd.apache.org/docs/2.2/mod/mod_headers.html for "unset" to remove headers. May 22, 2013 at 18:42
  • True, but I want to override, unsetting and then setting didn't seem to work for me then, though I don't remember exactly, thanks anyway.
    – Jaap
    May 22, 2013 at 21:40

2 Answers 2

0

mod_expires can't do that, but mod_header can. Its config is very simple:

Header set theHeader theValue
0

If you like yust to remove the Expires: -1 with mod_header you can also do:

Header unset Expires

in you proxy config.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .