This article describes how to use the YSlow browser extension to measure a website's performance. YSlow enables you to analyze pages and obtain page speed ratings.
To use YSlow, follow these steps:
You can significantly improve your site's speed by addressing each of the following testing criteria that YSlow uses:
Make fewer HTTP requests: The fewer items a browser downloads, the faster a site loads. For example, you can combine multiple CSS files into one file to reduce the number of HTTP requests. Combining small images into a single “sprite” reduces the number of connections to the server, and speeds up delivery of the page as a whole. CSS minification that automatically combines CSS files is also very helpful.
Put CSS at top: Pages appear to load faster when CSS code is at the top of the HTML document. Doing so enables the browser to begin applying CSS rules immediately as elements appear on the page. When CSS is placed after the HTML tags that it applies to, the page may not appear as intended until the CSS rules have been parsed by the browser.
Put JavaScript at bottom: Web browsers do not download JavaScript files in parallel with other files. In order to maximize the likelihood of browsers downloading your content in parallel and reducing page load times, move JavaScript (such as Google Analytics) to the bottom of the HTML document.
Minify JavaScript and CSS: Minimizing (removing unnecessary text characters, such as whitespace or comments) JavaScript and CSS files reduces their overall size. As a result, browsers need less time to download minimized files.
Remove duplicate JavaScript and CSS: Repeating CSS rules over and over (often in different files) not only increases the size of the file to be downloaded, but also forces the browser to parse CSS rules multiple times.
Reduce the number of DOM elements: The fewer HTML elements in a page (and thereby in the Document Object Model, or DOM), the faster the browser can parse it. Using lightweight templates that use the least amount of HTML to build a page can improve this. The larger a page is in HTML tags, the more processing time and RAM the browser must use to render the page.
Do not scale images in HTML: When a browser receives an image larger than the intended viewing size, the file size is larger than necessary and takes additional time to download. Instead, you should store images on the server at their intended viewing size.
For more information about YSlow, please visit http://yslow.org.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.