Jump to content

Cache only image


amitshah

Recommended Posts

Hello,

 

I have created one ecommerce site which have many images on the different webpages. I would like to cache them. For that i have used below code to cache content.

 

$expires = 60*60*24*2;
header("Pragma: public");
header("Cache-Control: must-revalidate");
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');

 

My webpage also content session and cookie and it shows number of product purchase on the page header. Using above code it also cache session and cookie and complete HTML page so number of product display wrong(old) on previously visited page.

 

Can any one assist me, how to cache only image content and not complete HTML with cookies?

 

Regards,

Amit Shah

Link to comment
https://forums.phpfreaks.com/topic/174665-cache-only-image/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.