How to set cache expiration date for entire jpg folder using .htaccess

How to set cache expiration date for entire image folder using .htaccess?

Right now, I want only the contents of one particular folder to get the cache expiration date. I am currently using the following code (inserted below), but I find it a pain because every time I add a new work of art, I have to add it to this list. Is there a way that I can just specify the entire folder?

<FilesMatch" (\.css|main_banner.jpg|cart.png|main_logo.jpg|favicon.ico|search_button.jpg|fp_banner.jpg)$"> Header set Cache-Control "max-age=2592000" </FilesMatch> 
+6
caching .htaccess
Nov 24 '09 at 9:07
source share
1 answer

Just put the .htaccess file in this folder. Then all you need is the Header set Cache-Control "max-age=2592000" directive Header set Cache-Control "max-age=2592000" , without worrying about the state of FilesMatch .

+8
Nov 24 '09 at 9:16
source share



All Articles