Reverse Proxy and Browser Caching
-
Proxy runs apache with mod_proxy. I have my VirtualHosts identified and SiteA is proxied to ServerA, SiteB to ServerB, etc. Reverse proxy has been working without issue for years. In trying to make use of browser caching I’m running into a roadblock. I’ve pieced together the various solutions I’ve been able to find but it’s still not working. On Proxy I have added the following in httpd.conf to try and enable browser caching at this layer:
<LocationMatch .*\.nocache\..*>
ExpiresActive On
ExpiresDefault “access”
</LocationMatch><LocationMatch .*\.cache\..*>
ExpiresActive On
ExpiresDefault “now plus 1 year”
</LocationMatch>Previous to that I tried the following with no success:
<Files *.nocache.*>
ExpiresActive On
ExpiresDefault “access”
</Files><Files *.cache.*>
ExpiresActive On
ExpiresDefault “now plus 1 year”
</Files>On ServerA I have the following in /var/www/html/.htaccess:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access plus 1 year”
ExpiresByType image/jpeg “access plus 1 year”
ExpiresByType image/gif “access plus 1 year”
ExpiresByType image/png “access plus 1 year”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType text/x-javascript “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 year”
ExpiresDefault “access plus 2 days”
</IfModule>
## EXPIRES CACHING ##To the best of my knowledge Proxy has the correct configurations in httpd.conf to permit browser caching as does the .htaccess file on ServerA where SiteA lives. Testing SiteA with various web tools reports that browser caching is not enabled. I am hoping fervently that someone has experience with this sort of setup and can help point me in the right direction. Thank you in advance!
The topic ‘Reverse Proxy and Browser Caching’ is closed to new replies.