Leverage browser caching (speed up my website)

Permalink 3 users found helpful
Hi,
I'm new to concrete5 and I ran into a stange problem.
i have a problem on the page speed on firebug (Leverage browser caching; score: '0/100'), and on the details:
The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
favicon.ico (expiration not specified)
style/style.css (expiration not specified)
styles.css (expiration not specified)
please can anyone help me to resolve this issue, thanks for any help, and sorry for the long post (and for my bad english).

View Replies: View Best Answer
adajad replied on at Permalink Best Answer Reply
adajad
You can add the following to your .htaccess to set browser cache if mod_expires is enabled on your apache installation.

# set browser caching
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType application/pdf A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/plain A2592000
ExpiresByType text/css A604800
# end browser caching
# TIME CHEAT SHEET
#      300   5 MIN
#      600  10 MIN
#      900  15 MIN

The 'A' before the time defines the time since last access. You can change that to 'M' if you want to use the file's last modification time instead.
mdekmak replied on at Permalink Reply
Thanks for the reply.
your answer is very great the score of caching will be 80/100 in page speed Firefox plugin.
but there are one file (/packages/simplestyle/themes/simplestyle/style/style.css (expiration not specified))
in the list of expiration caching.
please if you know a solution for this file please write to me in a new post.
thanks another time.
adajad replied on at Permalink Reply
adajad
try adding this as a default caching option
ExpiresDefault A2592000


Edit: just to clarify - 2592000 sec = 30 days
bjalexander replied on at Permalink Reply
bjalexander
This was the perfect thing to find today. Exactly what I needed. Thank you!
Yola replied on at Permalink Reply
Yola
Thanks Adajad, years later now but this is still is the perfect answer to my question!
mdashrafmalik replied on at Permalink Reply
Use This
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>

[url="http://webdeveloperbareilly.in/blog/seo/leverage-browser-caching.html"]Source[/url]