logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Remove Cache-Control header on matchingfiles
Author
gijs



Joined: 27 Apr 2012
Posts: 189
Location: The Netherlands

PostPosted: Sun 07 May '17 23:06    Post subject: Remove Cache-Control header on matchingfiles Reply with quote

I've configured Apache as a reverse proxy and enabled caching.

I've noticed that certain files are not being cached.
To prevent this I had set: Header unset Cache-Control

However, this also causes issues with login pages and user specific pages.

I've now set:
Code:
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Cache-Control
</FilesMatch>

However my .png files are still set with a private cache-control header.

Any idea how I can fix this?
Perhaps the path: domain.com/User_Themes/1/81c96704-feb1-4758-85d7-caa85671eb09/Images/ControlPanel/ isn't being included in the filesmatch directive?
Back to top
gijs



Joined: 27 Apr 2012
Posts: 189
Location: The Netherlands

PostPosted: Mon 08 May '17 23:19    Post subject: Reply with quote

The solution was to use Location, instead of Filesmatch:
Code:
<Location ~ \.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|ashx)$>
   Header unset Cache-Control
 </Location>

Apparently FilesMatch doesn't work for proxied content.
Back to top


Reply to topic   Topic: Remove Cache-Control header on matchingfiles View previous topic :: View next topic
Post new topic   Forum Index -> Apache