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
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.
- 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.
(It took about as long to cite this verbosely as it did to test).
I say all of that to ask the following questions:
Why does Page Speed Online give such funky results?
Not accurate, but moreover, the major disparity between using CloudFlare versus not, completely counter-intuitive.
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 :)
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.