0

I use virtuemart. There are a lot of images about the products. But this images come from a php file(imgtag.php), so I can't force the browser with this code to take the product images to the cache:

<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|ttf|eot|swf)$">
   Header set Cache-Control "max-age=2592000"
</FilesMatch>

Example for product image URL:

http://www.myshop.com/components/com_virtuemart/show_image_in_imgtag.php?filename=be6160cc3ede6b58d13f4adaa61f49f7.jpg&newxsize=120&newysize=120&fileout=

How can I do this?

user594297
  • 93
  • 2
  • 13

1 Answers1

2

You could modify your imgtag.php file, so it sends that header, using the PHP header() function :

header('Cache-Control: max-age=2592000');

Note : setting headers must be done before any output.

Pascal MARTIN
  • 385,748
  • 76
  • 642
  • 654