kevintynfron Posted December 16, 2008 Share Posted December 16, 2008 I have a server that I'm trying to reduce the server load over xmas/new year by introducing far-future expires headers and removing Etags and last-modified headers. The problem is that there's a subdirectory that I can't have the expires headers on because they are 'featured' images that change daily and I can't change the location because it's part of an automated system, etc. Here's the code in httpd.conf: # Turn on caching for the main img directories <directory "/var/www/vhosts/example.co.uk/httpdocs/img"> <FilesMatch "\.(jpg|jpeg|png|gif|swf)$"> ExpiresActive on ExpiresDefault "access plus 1 year" Header set Cache-Control "max-age=31536000, public" Header unset Last-Modified Header unset ETag </FilesMatch> </directory> # Turn off caching for the featured directory as images always have the names featured01.jpg, etc. <directory "/var/www/vhosts/example.co.uk/httpdocs/img/featured"> <FilesMatch "\.(jpg|jpeg|png|gif|swf)$"> ExpiresActive off Header unset Cache-Control </FilesMatch> </directory> So in pseudo-code, I want <Parent directory> Far-future expires header Long Cache-Control expires No Etag No Last-Modified </Parent Directory> <Specific subdirectory> No Far-future expires header No Long Cache-Control expires Etag Last-Modified </Specific subdirectory> Any ideas? I'm sure I could use "header set last-modified" or something like that, but can't find the details I'm after. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/137259-turning-last_modified-headers-back-on/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.