Go Back   Wiki NewForum | Latest Entertainment News > General Discussion


YSlow - Helping slow web pages load faster


Reply
Views: 2414  
Thread Tools Rating: Thread Rating: 1 votes, 4.00 average.
  #1  
Old 11-10-2009, 03:37 PM
bholus10 bholus10 is offline
Award Winner
 
Join Date: Nov 2009
Posts: 10,043
Default YSlow - Helping slow web pages load faster

This article is a continuation to my article about Firebug. YSlow is an add-on to Firebug that helps developers determine why a site is loading slowly.

After you install YSlow, if you open up Firebug in Mozilla a new tab will now appear called “YSlow”. The next steps would be to load a web site that you want to check it’s performance. After the web site has loaded, click the YSlow tab, if the results don’t compile automatically, click the Performance ****on to run the diagnostics.

The grading is made up of 13 steps. For each step you receive a grade from A to F. An overall grade is compiled in the same format.

The 13 steps are as follows:

1. Make fewer HTTP requests
2. Use a CDN
3. Add an Expires Header
4. Gzip components
5. Put CSS at the top
6. Put JS at the bottom
7. Avoid CSS expressions
8. Make JS and CSS external
9. Reduce DNS lookups
10. Minify JS
11. Avoid redirects
12. Remove duplicate scripts
13. Configure ETags

I normally ignore these items because they don’t usually apply to the sites that I’m optimizing: Use a CDN, Avoid CSS expressions, Reduce DNS lookups, and Avoid redirects. This helps reduce our list to 9 items.

I focus on the remaining 9 items in the following order: Make fewer HTTP requests, Remove duplicate scripts, Put CSS at the top, Put JS at the bottom, Minify JS, Gzip components, Expires header, and Configure Etags.

The easiest way to increase your score with HTTP requests is to group all of your CSS and Javascript into one large file each. After your Javascript is in one large, it makes it easier to clean up duplicate scripts.

After your CSS is into one file, ensure your one stylesheet include is within the tags of your site. Now you need to the same thing with your one Javascript file, instead add this
Award Winner
 
Join Date: Nov 2009
Posts: 10,043
Because I found no difference, I decided to remove the Expires headers and just add the ETags. To configure ETags, again in your .htaccess file, add the following line:

FileETag MTime Size

Save your file and reload your web site. You should have seen a significant improvement, but if your results were similar to mine, they weren’t as good as expires header. My load time went from 16 seconds to a respectable 5 seconds.

That’s all I have to share for this article. If you’ve found it useful, but would like more information on each of the 13 steps YSlow offers excellent descriptions of each.

Until next time.
Reply With Quote
Reply

Latest News in General Discussion





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.