Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Exipires headers for images #16

Open
jcteague opened this issue Mar 25, 2011 · 6 comments
Open

Exipires headers for images #16

jcteague opened this issue Mar 25, 2011 · 6 comments

Comments

@jcteague
Copy link

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
Copy link

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
Copy link
Member

jmeridth commented Feb 2, 2015

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

@jmeridth jmeridth closed this as completed Feb 2, 2015
@dahlbyk
Copy link
Member

dahlbyk commented Feb 25, 2015

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
Copy link
Member

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
Copy link
Member

dahlbyk commented Feb 27, 2015

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
Copy link
Member

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

@jmeridth jmeridth reopened this Feb 27, 2015
@jmeridth jmeridth added the bug label Feb 27, 2015
@jmeridth jmeridth self-assigned this Feb 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants