YSlow, an add-on plugin for Firebug, a must have tool for all web developers concerned about performance of their website. As shown in the picture below, analysis using Firebug reveals all the the performance bottlenecks.
YSlow, add-on plugin used along with Firebug, gives more detailed analysis and suggests useful tips to improve the performance. It has a grading system on a scale of A to F, A being the highest performer. Given below is the snapshot of its report run on this blog.
This blog got a grade of 'B' with overall performance rating of 80%. From the report we can see that non-usage of CDN, DNS lookups, inline and uncompressed javascripts and css files brought down the performance score. There are number of techniques and tips provided on YSlow website, that helps to improve the grades.
Developers working on frameworks like Grails or JSF may find some practical difficulties in implementing some of the techniques listed.
1) Combining all javascript files and css files
2) Adding all the script files (*.js) files at the bottom of the page.
When using grails plugin, the plugin may require few css files and js files of its own. Similarly, when using RichFaces for JSF the RichFaces framework may include number of js and css files depending on the component used. The idea behind is to use only the scripts that are absolutely necessary to run the Richfaces component or a grails plugin. But when we use more than one component we will have to face the burden of loading multiple script files. Obviously, this impacts the performance and thus a low YSlow grade. Incase of RichFaces, JSF library, we could use an inbuilt optimizing technique provided by the framework.
By adding the following context parameters to the deployment descriptor, web.xml, we will be able to combine all the scripts used in the richfaces component. I wish there is similar technique for Grails applications as well.
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
For web applications, that donot use any of the frameworks, where developer have complete control of the content (html, css, scripts, images et) it is easy not very difficult to get graded as "A" by YSlow. However, I noticed the tool deosn't take into account - the response time from the server. As long as as the tool's prescribed criteria is met, we can sit on Grade - A. In an instance where content from the server take about 10secs to load and if the content content-encoding is gzip, YTool gives it an A-Grade. (Assuming all the other rules are satifisfied by the application).
Therefore, in my opinion, rather than using the tool as a benchmark in comparing various competing websites it should be used to identifify all the performance bottlenecks in webapplications and take corrective actions. In my future posts I will be able to post some techniques used to get better grade when a combination of the following components are used in a web application. An Apache server acting as a proxy to a Tomcat application server using AJP connector. The database used in the tuning excercise is MySql.
YSlow, add-on plugin used along with Firebug, gives more detailed analysis and suggests useful tips to improve the performance. It has a grading system on a scale of A to F, A being the highest performer. Given below is the snapshot of its report run on this blog.
This blog got a grade of 'B' with overall performance rating of 80%. From the report we can see that non-usage of CDN, DNS lookups, inline and uncompressed javascripts and css files brought down the performance score. There are number of techniques and tips provided on YSlow website, that helps to improve the grades.
Developers working on frameworks like Grails or JSF may find some practical difficulties in implementing some of the techniques listed.
1) Combining all javascript files and css files
2) Adding all the script files (*.js) files at the bottom of the page.
When using grails plugin, the plugin may require few css files and js files of its own. Similarly, when using RichFaces for JSF the RichFaces framework may include number of js and css files depending on the component used. The idea behind is to use only the scripts that are absolutely necessary to run the Richfaces component or a grails plugin. But when we use more than one component we will have to face the burden of loading multiple script files. Obviously, this impacts the performance and thus a low YSlow grade. Incase of RichFaces, JSF library, we could use an inbuilt optimizing technique provided by the framework.
By adding the following context parameters to the deployment descriptor, web.xml, we will be able to combine all the scripts used in the richfaces component. I wish there is similar technique for Grails applications as well.
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
For web applications, that donot use any of the frameworks, where developer have complete control of the content (html, css, scripts, images et) it is easy not very difficult to get graded as "A" by YSlow. However, I noticed the tool deosn't take into account - the response time from the server. As long as as the tool's prescribed criteria is met, we can sit on Grade - A. In an instance where content from the server take about 10secs to load and if the content content-encoding is gzip, YTool gives it an A-Grade. (Assuming all the other rules are satifisfied by the application).
Therefore, in my opinion, rather than using the tool as a benchmark in comparing various competing websites it should be used to identifify all the performance bottlenecks in webapplications and take corrective actions. In my future posts I will be able to post some techniques used to get better grade when a combination of the following components are used in a web application. An Apache server acting as a proxy to a Tomcat application server using AJP connector. The database used in the tuning excercise is MySql.
Comments
Post a Comment