Friday, March 11, 2011

Using advanced options

To view additional Page Speed options, select the Page Speed tab, and click the down arrow to display an options pop-up menu:


Each is described below.

Automatically run at onload

This option causes Page Speed to automatically analyze a page as soon the page loads. As long as the option is enabled, Page Speed will run automatically for all subsequent pages you visit.
To automatically run Page Speed when a page is loaded:
  1. Open Firebug, select the Page Speed tab, and click the down arrow to display the options pop-up menu.
  2. From the pop-up menu, select Automatically Run at Onload.
  3. Navigate to the web page you want to analyze. When the page is finished loading, Page Speed automatically runs the analysis. 

Profile deferrable JavaScript

This option runs the test for deferred loading of JavaScript and is disabled by default. This test gathers JavaScript coverage data from the Firefox JavaScript Debugger Service to determine which functions a page has called (or not) by the time the onload event is triggered. The Debugger Service tracks the state of the entire Firefox session in a single global space in memory; that is, the state is not per page load, and it is not cleared after a page reload. This means that if you run the profiler the first time you visit the page in a Firefox session, the score will be accurate for that visit. But if you continue to use the page, and additional JS is loaded and executed, profiling the page at that point will not report accurate results. Furthermore, if more than one page references the same external JS file, the profiler only reports results for the first page visited.
To guarantee that your performance score on this test is accurate, be sure to run it when you first start Firefox:

  1. (Re-)start Firefox.
  2. Select Tools > Firebug > Open Firebug.
  3. In the Firebug window, select the Page Speed tab, and click the down arrow to display the options pop-up menu
  4. From the pop-up menu, select Profile Deferrable JavaScript.
  5. Navigate to the web page you want to analyze. 
  6. When the page has finished loading, click Analyze Performance.
  7. To run the profiler against another page, close Firefox and restart the procedure.
Note: This option significantly slows down browsing and can cause Firefox to hang, especially if you open multiple browser tabs. We recommend that you keep the option disabled until you are ready to use it, and disable it when you finish using it.

Save optimized files

Page Speed automatically optimizes JavaScript, CSS, and image files referenced from a page when you run the analysis. By default, the optimized files are saved to the following directories:
  • Linux:/tmp/page-speed-[css | javascript | images]/
  • Windows: C:\Documents and Settings\username\Local Settings\Temp\page-speed-[css | javascript | images]\
  • Mac OS X: /Users/username/Library/Caches/page-speed-[css | javascript | images]/
However, you can change the directory to which Page Speed should save the files. To do so:
  1. Open Firebug, select the Page Speed tab, and click the down arrow to display the options pop-up menu.
  2. From the pop-up menu, select Save Optimized Files To, and select a directory from the predefined options, or select Choose a Custom Path to specify a custom directory.

Set user agent

Page Speed generates scores based on the page loaded by Firefox. However, to work around differences in browser behavior, some websites serve different content based on the user's browser. Web servers determine which browser is making the current request based on a user agent string that the browser sends with each request.  If your site serves different content based on the user agent string, and you want Page Speed to grade the content served to a specific browser, you can use the Set User Agent option.
Note that a page that works in another browser may not work in Firefox, so it is possible that a page you profile with a different user agent is not exactly the same as what a user of that browser would see. However, often the differences are only cosmetic, and Page Speed's recommendations are still valid.
To select a different user agent:
  1. Open Firebug, select the Page Speed tab, and click the down arrow to display the options pop-up menu.
  2. Optionally, to display additional user agent options, select Show All User Agents.
  3. From the pop-up menu, select and select the user agent you want to test against.
  4. Navigate to the web page you want to analyze.
  5. When the page has finished loading, click Analyze Performance.
  6. To rerun the test with another user agent, repeat steps 2 to 4.
Note: The user agent options can cause Firefox to hang for some web pages. We recommend that you keep the Default Value setting for basic usage.

No comments: