PageSpeed Service was turned off on August 3rd, 2015. Please see Turndown Information for PageSpeed Service.
To speed up web pages by caching and prioritizing visible contents of the page.
This is a new rewriter, so please preview your site as described here, to ensure that it works for your site before making it live.
This rewriter renders the visible content much sooner by:
- Making HTML cacheable: HTML is typically not cached because small portions of the page are non-cacheable due to personalized content. Non-cacheable portions are stripped from the HTML, and the rest of the page is cached on PageSpeed servers.
- Prioritizing visible content: Rendering a modern web page requires lots of network resources but not all of them are needed right away. Visible content of the page is prioritized on the network and the browser so it doesn’t have to compete with the rest of the page.
Configuring the rewriter
You need to provide the following inputs to configure the rewriter as shown
- URL Pattern: This identifies the parts of the site to which this rewriter is applied. It is specfied using a wildcard pattern. For the configuration shown, this rewriter is applied to the entire site.
- Cache time: This identifies how long the cacheable portions of the pages are cached. The default is 30 minutes. The higher the cache time, the higher the probability that your pages will be in PageSpeed server's caches. Higher cache times may also mean your site will show stale content, so pick the longest cache duration that is acceptable for your site.
- Non-cacheable Parts: This identifies the portions of the page that are not
cached on PSS servers. It is specified using
Let's look at a sample page of an ecommerce site and see how to identify non-cacheable portions on the page. In this page the non-cacheable portions are username and price. If we look at the HTML page source, they appear in the page as
<span id="username"> firstname.lastname@example.org </span> <span class="price"> email@example.com </span>
These non-cacheable portions should be specified as id=username,class=price.
The effect of this rewriter on this page can be observed before and after rewriting. In this example, an intentional delay of a few seconds has been added to the non-cacheable portions so you can observe that they are rendered later.
- PSS fetches the web page from your origin servers, stamps out the portions marked as non-cacheable, identifies visible portions of the page and caches it.
- When a user visits your site, the browser requests the page from PSS.
- In parallel, PSS requests the HTML web page from your origin site.
- PSS extracts only the non-cacheable portions from the full HTML and sends it to the browser.
- This rewriter doesn’t work if different content is served for the same URL based on cookies, IP, etc.
- This rewriter works on modern browsers - IE9, Firefox 3+, Chrome, Safari. It is not applied on pages served for mobile devices, tablets and all other user agents.
- If some users are seeing admin panels or personalized content for other users, your specification of non-cacheable portions is incomplete. You need to mark those portions as non-cacheable.
- If you have a problem with this rewriter, turn off the rewriter and then contact us by email at firstname.lastname@example.org.