3

I'm trying to change the cache-control & Expires headers coming through an apache reverse_proxy. I can't change the origin server configs or code ATM.

 ExpiresActive On
  Header unset Etag
  Header unset Cache-Control
  Header unset Expires
  <LocationMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "max-age=290304000, public"
  </LocationMatch>

.. and

<LocationMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresActive On
Header unset Etag
Header unset Cache-Control
Header unset Expires
Header set Cache-Control "public"
  Header set Cache-Control "max-age=290304000, public"
</LocationMatch>

are not doing it & when restarting apache2 there are no complaints about the config.

Testing by using "curl -I ...image.jpg"

rumaeagle
  • 31
  • 3

1 Answers1

1

Can maybe dodge the problem by setting multiple locations having different headers on each.

ex.

<Location /resources/>
  Header unset Etag
  Header set Cache-Control "max-age=290304000, public"
  Header unset Expires
  ProxyPass {ajp|http}://host:port/resources/
  ProxyPassReverse {ajp|http}://host:port/resources/
</Location>
<Location //>
  Header add "Instance_1"
  ProxyPass {ajp|http}://host:port/
  ProxyPassReverse {ajp|http}://host:port/
</Location>
user2821144
  • 121
  • 3
  • 2