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
Web DevelopmentBlogsWordPressWeb Browsers

Avatar of undefined
Last Comment
Nura111

8/22/2022 - Mon
Ray Paseur

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
jeremyjared74

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Nura111

ASKER
Thank you do you a have a good reference on how to setting the W3 total cache on a shared host?
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

-->
Your help has saved me hundreds of hours of internet surfing.
fblack61
jeremyjared74

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

ASKER
Yea I read it but I didn't find a solution to the debug info problem.
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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Nura111

ASKER
?
David Johnson, CD

http://nurit.chicagonewshub.com/ if this is your site it is already optimized 98/100
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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Nura111

ASKER
my website is a word press site its php driven not ASP
disrupt

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
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
disrupt

Nura111

ASKER
yes
but its still suggest to minify like I mentoined  aboved and I dont understand why
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
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 ?

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

ASKER
didnt really solve my problem
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.