How to set an expiration to Leverage browser caching?

Nura111
Nura111 used Ask the Experts™
on
when I test my site in http://pagespeed.googlelabs.com/ 
Its suggest to Leverage browser caching ;
"The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:"

Can somebody please explain what does it mean and how to set the expiration date?

Thank you
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:
You can do this with a meta tag that gives the page a future expiration date.

I do NOT recommend that at all.   Here is the meta tag I use:

<meta http-equiv="Expires" content="Mon, 01 Jan 1990 01:00:00 GMT" />

The reason I use a previously-expired date is that I want to see the new content on my site every time, and I do not want to have the browser cache my data.  Cacheing might be good for performance, but it is troublesome to the web publisher who is trying to change HTML, JS, CSS, images, etc., and see the results of the chances.  So I do not do it.  However, YMMV.

All the best, ~Ray
You are better off using the plug-in W3 Total Cache. It lets you set a expires header and exclude logged in users. There are several other benefits of using this plug-in. I consider it a "must have".

Author

Commented:
Thank you do you a have a good reference on how to setting the W3 total cache on a shared host?
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Author

Commented:
also its seem like its improving after installing W3 total cache the results in page speed is better.  

But w3 total cache have a debugging option that you can see the results in the end of the HTML source code.

and its seem like its sating that its disabled. *I have a another question like that but noone answer so Itried to ask it here again)

<!-- W3 Total Cache: Page cache debug info:

Engine:             disk (enhanced)

Cache key:          _index.html

Caching:            disabled

Reject reason:      Requested URI has a trailing slash

Status:             not cached

Creation Time:      2.483s

Header info:

X-Pingback:         http://nurit.chicagonewshub.com/xmlrpc.php

Content-Type:       text/html; charset=UTF-8

X-Powered-By:       W3 Total Cache/0.9.2.3

-->
The help docs are pretty useful for learning how to tweak the settings. Go to the admin Panel and select the FAQ's link from the top menu for detailed help section.

Author

Commented:
Yea I read it but I didn't find a solution to the debug info problem.

Author

Commented:
ok so I tried to install w3 total cache on one site and w super cache on another and I still get the Leverage browser caching from the page speed on both of them I enabled page cache browser and minify on w3 total and on the super cache enabled the caching

Author

Commented:
?
Top Expert 2016

Commented:
http://nurit.chicagonewshub.com/ if this is your site it is already optimized 98/100

Author

Commented:
How can I optimize images ?  
this site is just my testing site it doesn't have a lot of content so its rank high but on diffrent one with a lot of images im experiencing problems (but even in this one I would like to optimize the images)
A. im not sure how to optimize the images (that are not in the media libary but in in the theme images folders, or links to images_

B. and you couls also see that problem on the website minify html even after enabling ther minify in the w3 total cache setting I still get this message)

Thank you

Author

Commented:
my website is a word press site its php driven not ASP

Author

Commented:
my main problem at the moment is  even that I have w3 total cache installed and configures to minidy html/css/js I still get a suggestion in page speed ti minify html and js

Minifying the following HTML resources could reduce their size by 597B (3% reduction).
Minifying http://www.chicagonewshub.com/ could save 597B (3% reduction) after compression. See optimized version.


Minify JavaScript
Minifying the following JavaScript resources could reduce their size by 278B (3% reduction).
Minifying http://viralvideochart.unrulymedia.com/resource/js/viralvideochart.js could save 278B (3% reduction) after compression. See optimized version.

More information

Author

Commented:
yes
but its still suggest to minify like I mentoined  aboved and I dont understand why

Author

Commented:
Maybe I misundersand  the minfy instruction do I need manully to find the what need to minify and add it manually to the w3 total cache ?

Author

Commented:
from w3 total cache help:  

where am I adding those in the plugin?
back to top

How do I find the JS and CSS      to optimize (minify) them with this plugin?

View your page source in your browser and search for any <style>, <link> or <script> tags that contain external CSS or JS files and one by one add them to the minify settings page. Do not include any CSS in conditional statements (unless you know what you are doing) like:

<!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/wp-content/themes/default/lte.css" media="screen,projection" /><![endif]--> Or simply use the "Help" tool available on the minify settings page which will identify CSS and JS files used in the templates of your theme and properly assign them to the same. Simply tick the checkbox for files you wish to minify, click "Apply & close", then save your settings.

The plugin will combine, minify, HTTP compress and check for updates to these files automatically from now on. If you have any CSS or JS that are inline consider making them external files so that you can use them with minify.

Author

Commented:
didnt really solve my problem

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