How to specify a longer expiration on images?

sandshakimi
sandshakimi used Ask the Experts™
on
I run GTmetrix to measure my page loads. Here is a section about leveraging browser caching.

Report reccommends specifying an expiration on several image files on the site.

What's a good approach?
gtmetrix1.JPG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2016

Commented:
What is the URL that demonstrates this behavior?

Author

Commented:
It's not a public site yet. Still on staging.
greetings sandshakimi, , many browsers use a standard "default" caching cycle, which is what I will consider for this, BUT you can change the caching times and ways in the settings.

BUT on page first views, the caching does not usually do anything to decrease load times. BUT to have properly sized images, in a smaller image file compression (like .jpg),can fantastically reduce load times.

In your page speed recomends of image, it says - "short freshness lifetimes", which has NO meaning in any server date settings, as freshness is more for vegetables than binary file system files. What you need to do is have a expiration date that is far in the future, years maybe. OR remove any expires indicators from the file dating that goes to the browser.
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Most Valuable Expert 2011
Top Expert 2016

Commented:
I think we would need to see the HTML, as well as the contents of the report to understand the issue (if there is any issue).  For example, the image says, "... the following resources ..." but the image is cut off, so we cannot see what resources GTMetrix is talking about.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014
Commented:
Furthermore, until your site is done, you don't really want long cache times because it will make it difficult to see changes that you make.
Most Valuable Expert 2011
Top Expert 2016

Commented:
+1 for what DaveBaldwin said!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial