lostechies / wordpress

Our wordpress install
http://lostechies.com
Other
3 stars 2 forks source link

Exipires headers for images #16

Open jcteague opened 13 years ago

jcteague commented 13 years ago

site is really fast, but the logo image is huge is and is like 85% of the landing page file size.

This is from YSlow There are 14 static components without a far-future expiration date.

(no expires) http://lostechies.com/wp-includes/js/l10n.js?...
(2011/3/25) http://www.google-analytics.com/ga.js
(no expires) http://s1.lqcdn.com/m.min.js?...
(no expires) http://lostechies.com/wp-content/themes/lostechies/style.css?...
(no expires) http://lostechies.com/wp-content/themes/lostechies/960/960.css
(no expires) http://lostechies.com/wp-content/themes/lostechies/jquery-ui-1.8.1.custom.css?...
(no expires) http://lostechies.com/wp-content/plugins/syntaxhighlighterpro/styles/shCore.css?...
(no expires) http://lostechies.com/wp-content/plugins/syntaxhighlighterpro/styles/shThemeDefault.css?...
(no expires) http://lostechies.com/wp-content/themes/lostechies/images/header_bg.png
(no expires) http://lostechies.com/wp-content/themes/lostechies/images/lostechies_logo.png
(2011/3/25) http://www.feedburner.com/fb/images/pub/feed-icon16x16.png
(2011/3/25) http://feeds.feedburner.com/~fc/LosTechies?...
(no expires) http://a.lakequincy.com/img/634173069453348170.png
(2011/3/25) http://feeds.feedburner.com/~fc/LosTechies?...
jagregory commented 13 years ago

The header logo is nearly 600kb, I'm sure you could compress that down a bit. You could always ditch the 24bit png and overlay it on the background (being as we only appear to be using it on the single background).

Randomly trying online, Smush.it can get compress it down to 52kb without even changing the transparency.

jmeridth commented 9 years ago

looks like the header image is 57 KB now. Looks like someone did it. :smile:

dahlbyk commented 9 years ago

It would still be a best practice to get far-future expires headers on the static resources, e.g. https://thomasgriffin.io/how-to-leverage-browser-caching-in-wordpress-via-htaccess/.

jmeridth commented 9 years ago

This has been added to the .htaccess file, like the blog post suggested.

## EXPIRES CACHING ##
<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 text/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>
## EXPIRES CACHING ##
dahlbyk commented 9 years ago

Interesting... PageSpeed seems to be happy with most of the WP assets, but not the files under /wp-content/themes/lostechies: 2015-02-27_09-25-27

jmeridth commented 9 years ago

Hadn't played with PageSpeed. Nice. That'll give me plenty to do to try and speed up LT. :+1: Thanks for sharing.