Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

In optimizing a content blog of mine with the goal of achieving the highest page speed score possible for obvious reasons (user experience, SEO, etc..), the results I'm obtaining are throwing me for a loop.

For the sake of completeness, here is my stack:

  • CloudFlare DNS + CDN
  • nginx 1.0.11 stable
  • PHP-FPM 5.3.6
  • WordPress latest stable (3.3.1)
  • WP-Super Cache

Moving on...

I originally was using Page Speed Online to have Google scrape the root URL and see what it turned up, as I assumed that'd be the most accurate representation of the speed it realized when evaluating the website for SEO purposes. However, the results are... intriguing to say the least. I've looked at the headers extensively (sessions, anonymous users, cached vs not-cached, etc..), yet Page Speed Online seems to report back incorrect results.

After purging every cache that I had and still getting the same funny recommendations by Page Speed Online, I tried out the Chrome extension. Here are my findings:

  • Page Speed Online reports that I should "leverage browser caching" for the majority of my static assets, citing that the expires duration on the majority of them is 24h or less, despite the fact that I can repeatedly replicate viewing the headers and seeing that the expires date is correctly set for 1 week as I have in my nginx configuration. This applies to .js, .css. png, .jpg, etc....

    • Also, CloudFlare states that it respects any expires headers you have greater than its default 4h, which doesn't seem to be a problem.

  • With CloudFlare Enabled, Page Speed Online reports a score of a 75, with only 2 medium-priority critiques (one of which is the above caching "issue" which isn't actually valid) and one low-priority. Without CloudFlare enabled, I get a score of 88 with the same 2 medium-priority reccomendations, but instead 9 low-priority (ex: I was having CloudFlare handle minification of static assets, asynchronously load some of the JavaScript, etc...).

    • Keep in mind this is on a 613MB 32-bit EC2 Micro-Instance with poor I/O performance and short CPU bursts. Granted, I'm caching a lot of trips to the disk, but an 88 without CloudFlare and 75 with?


Fast-forward to Page Speed Chrome Extension...

  • No cached content, no CloudFlare: 94
    • (1 medium-priority, 9 low-priority)

  • Server-side cached page, no CloudFlare: 95
    • (0 medium-priority, 9 low-priority)

  • No server-side cached page, with CloudFlare): 92
    • (2 medium-priority, 7 low-priority)

  • Server-side cached page, with CloudFlare): 96
    • (0 medium-priority, 7 low-priority)

Just to be clear, the local cache (cached by Chrome) was cleared before any of the above were run.

In the case of the first and third, I ran the test as an administrative user with a session and was not served the Super Cache page. For the second and fourth, I verified that the server-side cache was populated and requested the page as an anonymous user (and was subsequently served the cached page).

In the case of the requests not using CloudFlare, no minification was present for the first, and only HTML minification for the second.

For the tests using CloudFlare, HTML, CSS, and JavaScript minification were performed/served automatically, and additionally, resources were combined and required asynchronously when applicable. Also, all static assets were cached and served by the CloudFlare CDN rather than from my EC2 instance. The only "cache distinction" I make in these two tests was the case of a Super Cache static version of the dynamic page being present in-memory or not (present && hit).


Phew.
(It took about as long to cite this verbosely as it did to test).


I say all of that to ask the following questions:

  1. Why does Page Speed Online give such funky results?

    Not accurate, but moreover, the major disparity between using CloudFlare versus not, completely counter-intuitive.

  2. You can see above the night-and-day difference between Page Speed Online and the Page Speed Chrome Extension. Which is a more accurate representation of how Google's algorithm would rank your page in regards to speed?

    I'm really hopping it's the latter :)

  3. What gives with CloudFlare scoring lower in the both Online and Extension cases without a server-side static cached page?

    Intuitively, I'd expect that the several performance advantages that CloudFlare offers to at the very least be superior to any variation of a non-CloudFlare test (minification of JS, CSS, HTML, CDN for all static assets including images (a hefty portion of the payload), asynchronous loading, etc... What gives?


I applaud you if you've managed to read and stay attentive this far. Thanks so much for the time and consideration, and I appreciate any insights anyone can provide in advance!

Just for the sake of transparency, I also posted this to Quora.

share|improve this question
add comment

1 Answer 1

Please note: I am answering based on what you've described above only (which, while descriptive, isn't the same as analysing the source(s)).

To your questions above:

  1. From Google Page Speed's own FAQ:

    Some of the suggestions differ from the Page Speed browser extensions. Why?
    Page Speed Online uses a different rendering engine and user agent, which may impact the content being fetched for a site.

    How is Page Speed Online different from the Page Speed browser extensions? Which should I use?
    Page Speed Online provides the same analysis as the Page Speed browser extensions for Chrome and Firefox, without needing to install a browser extension.

    Next, you need to understand that CloudFlare (which I use) can/does modify some of the HTTP headers of the elements being requested/responded - expiry headers, etags and the like. Also, cookies are attached to non-cookied domains.

  2. Neither. I wouldn't consider Google's measurement "authoratative" but "representative" only. There's other methods/tests like http://webpagetest.org, http://pingdom.com etc that can give you other geo-specific results.

  3. As mentioned above, CloudFlare adds some minor additional payload (cookies, etc) to your entire page package. This should be offset by it's CDN capability and other important things like TTFB (Time to First Byte) which have more of a speed impact.

As I mentioned, I use CloudFlare on a number of sites and have optimized them for speed (and Page Speed) to almost 100. The thing to remember is that even with a perfect 100 score, you can still have a slow site. In fact the actual "speed" metric that Google uses for SEO purposes is it's own Toolbar (more here).

If you really want to address speed, you need to address other second-hogs - I recommend http://zoompf.com for picking up on all the other bloat. Lastly, server-speed has a lot to do with things - and not just back-end processing, but connectivity.

I'm not the most technical webby around, but hopefully that helped.

share|improve this answer
    
Great response! I'll certainly look into the resources you've provided, thanks for the verbosity! I'll leave the question open just in case anyone has anything additional to contribute, but I thoroughly appreciate the insight you've provided! –  Dan Simmons Jan 22 '12 at 22:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.