Link to home
Start Free TrialLog in
Avatar of ullfindsmit
ullfindsmitFlag for United States of America

asked on

HTML Cache External Images Only

In process of trying to optimize the recommendation we are getting from google's page speed insights ( is to leverage caching.

What meta tag do we need to use to specify caching images (local and external) longer (say 3 months) and caching the HTML of the page for only a week?

The goal is to leverage public cache pools by using
Avatar of James Williams
James Williams
Flag of United States of America image

It's not a META tag.

Its a server Issue  or setting

If you use IIS

Avatar of ullfindsmit


Unfortunately some (or even a good majority) of the images come from third party servers that I have no control over
Image files don't have META tags or any other HTML in them.  That would have to be done on the server.  Here's a page about doing in Apache:  I don't know how to set this up in IIS.  I that in the other comment.

If they're from third party servers, there is nothing you can do about it.
So is there an HTML tag on the HTML page that I can use to say cache this page and its contents (local and external images) for 7 days?
Avatar of James Williams
James Williams
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
While it aint pretty, it does the job
Glad You appreciate that script....

Who needs pretty, when your sneaky.

You could Save the external image to a local FOlder.
 Add a Check to see if the File exists before the PHP
gets the external Image.

Regards Selvol