ySlow make your pages fly
24/04/2008
With ySlow it's easy to optimize your page, it will give you allot of tips to really make your pages fly. ySlow is an extension created by yahoo.
Here you can see my results. They are really impressive, the size of the page has gone from 580k to 253k on the first load. A cached page has even greater performance gains, from 45k to just 2.5k. Almost 20 times smaller. So here is how i did it.
Tools to use
First use the Jsmin to compress javascript, and CSSTidy for your CSS. Also i use htaccess for Gzip to remove the Etags and set the far future expires. You will need to enable mod_expires and mod_gzip in your apache installation for this to work. Deflate is for apache 2, if you run apache 1.3 use Gzip
- <IfModule mod_deflate.c>
- # compress content with type html, text, and css
- AddOutputFilterByType DEFLATE text/css text/html text/javascript application/javascript application/x-javascript text/js
- <IfModule mod_headers.c>
- # properly handle requests coming from behind proxies
- Header append Vary User-Agent
- </IfModule>
- </IfModule>
- <IfModule mod_gzip.c>
- mod_gzip_on Yes
- mod_gzip_item_include file \.js$
- mod_gzip_item_include file \.css$
- mod_gzip_item_include mime ^image/
- mod_gzip_item_include file \.php$
- mod_gzip_item_include file \.pdf$
- mod_gzip_item_include mime ^text/html
- mod_gzip_item_include mime ^text/css
- mod_gzip_item_include mime ^application/x-javascript
- mod_gzip_item_include mime ^text/plain
- mod_gzip_item_include mime ^application/force_download$
- mod_gzip_item_include mime ^application/pdf$
- </IfModule>
- <IfModule mod_expires.c>
- ExpiresActive On
- ExpiresByType text/css "access plus 10 years"
- ExpiresByType text/js "access plus 10 years"
- ExpiresByType text/javascript "access plus 10 years"
- ExpiresByType application/javascript "access plus 10 years"
- ExpiresByType application/x-javascript "access plus 10 years"
- ExpiresByType image/png "access plus 10 years"
- ExpiresByType image/gif "access plus 10 years"
- ExpiresByType image/jpeg "access plus 10 years"
- ExpiresByType image/jpeg "access plus 10 years"
- </IfModule>
- FileETag none