Link to home
Start Free TrialLog in
Avatar of Nura111
Nura111

asked on

How to set an expiration to Leverage browser caching?

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
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

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
ASKER CERTIFIED SOLUTION
Avatar of jeremyjared74
jeremyjared74
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nura111
Nura111

ASKER

Thank you do you a have a good reference on how to setting the W3 total cache on a shared host?
Avatar of Nura111

ASKER

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.
Avatar of Nura111

ASKER

Yea I read it but I didn't find a solution to the debug info problem.
Avatar of Nura111

ASKER

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
Avatar of Nura111

ASKER

?
Avatar of David Johnson, CD
http://nurit.chicagonewshub.com/ if this is your site it is already optimized 98/100
Avatar of Nura111

ASKER

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
Avatar of Nura111

ASKER

my website is a word press site its php driven not ASP
Avatar of Nura111

ASKER

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
Avatar of Nura111

ASKER

yes
but its still suggest to minify like I mentoined  aboved and I dont understand why
Avatar of Nura111

ASKER

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 ?

Avatar of Nura111

ASKER

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.
Avatar of Nura111

ASKER

didnt really solve my problem