whit3fir3 Posted December 10, 2009 Share Posted December 10, 2009 I have a site I am working on with lots of images. A vast majority of these images are being stored in a MySQL database. I am trying to turn Future Expires headers on so clients do not have to download the images every time they visit the site, but I am having problems getting the headers to work for images that are stored in the database. I have added the following to my Apache Site config and it works great for everything but database images: <FilesMatch "\.(jpg|jpeg|png|gif|js)$"> ExpiresActive On ExpiresDefault "access plus 1 year" </FilesMatch> I have played with this some trying to get it to work with images that are stored in the database. The latest attempt was the following: <FilesMatch "\.(jpg|jpeg|png|gif|js|image.php?cid=^\d{1,7}$)$"> ExpiresActive On ExpiresDefault "access plus 1 year" </FilesMatch> The name of the file that gets the images out of the database is called image.php. This looks for 1 of 2 URL variables to be passed to it named either iid or cid. The values for these variables are numeric and currently 4 digits in length. I tried adding a regular expression to handle the numeric values that might be passed to the image file, but apache did not seem to like that. Any ideas of what I might be doing wrong here? Thanks, Whit3fir3 Quote Link to comment 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.