YSlow & Improving Speed

Yahoo! came out with a FireBug addon – YSlow, that takes a look at your web page and offers a score on performance. Most of the recommendations are easy enough to follow, below are 3 that take some Apache httpd.conf hacking to get working:

1) Configure ETags

Add this to your httpd.conf

FileETag MTime Size

 

2) Turn on Expiration Headers

# Turn on Expires and set default to 0

ExpiresActive On

ExpiresDefault A7200

 

# Set up caching on media files for 1 year

<FilesMatch “\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$”>

ExpiresDefault A29030400

</FilesMatch>

 

# Set up caching on media files for 1 week

<FilesMatch “\.(gif|jpg|jpeg|png|swf)$”>

ExpiresDefault A604800

</FilesMatch>

 

# Set up 24 Hour caching on commonly updated files

<FilesMatch “\.(xml|txt|html|php|js|css)$”>

ExpiresDefault A86400

</FilesMatch>

 

3) Add Gzip compression

Install mod_gzip for Apache, add this to your httpd.conf to configure mod_gzip to handle files/settings

<IfModule mod_gzip.c>

 mod_gzip_on Yes

mod_gzip_can_negotiate Yes

mod_gzip_static_suffix .gz

AddEncoding gzip .gz

mod_gzip_update_static No

mod_gzip_command_version ‘/mod_gzip_status’

mod_gzip_keep_workfiles No

mod_gzip_minimum_file_size 512

mod_gzip_maximum_file_size 1048576

mod_gzip_maximum_inmem_size 60000

mod_gzip_min_http 1000

mod_gzip_handle_methods GET POST

 

mod_gzip_item_include mime ^text/.*

mod_gzip_item_include mime ^httpd/unix-directory$

mod_gzip_item_include file \.shtml$

mod_gzip_item_include file \.html$

mod_gzip_item_include mime ^application/x-javascript$

mod_gzip_item_include mime ^application/javascript$

mod_gzip_item_include file \.js$

mod_gzip_item_include file \.css$

mod_gzip_item_include mime ^application/x-httpd-php$

mod_gzip_item_include file \.php$

mod_gzip_item_include handler ^cgi-script$

 

mod_gzip_dechunk Yes

 

# DO NOT WASTE TIME COMPRESSING IMAGES

mod_gzip_item_exclude mime ^image/.$

mod_gzip_item_exclude mime ^image/

mod_gzip_item_exclude rspheader Content-Type:image/*

</IfModule>

 That’s it, those 3 changes improved my score from F (60) to a respectable B (81).

image

Tim

A .NET, PHP, Marketing Guru authority, at least I hope I am. Reach me at tboland@gmail.com

8 thoughts on “YSlow & Improving Speed

  1. Kathleen says:

    This was extremely helpful. Thanks for posting!

  2. I am currently done it as well as discover that this blog post is actually fantastic.

  3. Here on this site free codes of xbox live game are available so if you wanna free codes of xbox live game then you should visit on this site and amke your payable game absolutely free Thak you

  4. Authors site says:

    Utilizing this card you could now check out your favorite smash hits or get applications devoid of spending anything at all. http://fbgamescheats.net/free-google-play-gift-card-codes

  5. Nice post i like this post this is an awesome post for xbox live game here on this site and make your payable game absolutely free Thank you

  6. This site provide us free codes of xbox live game here on this site so if you wanna free codes then you should visit on this site

  7. hack says:

    Learn hack for using the generators and how to earn and get gold .

  8. hey guys if you want more and more robux then try my link to get lots of robux for free

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>