To run through some of the nuances and discussions we have internally, I thought it might be a nice exercise to blog about the ones I discovered for our very own blog, which happens to be using the WordPress system (in this version of the site).
Impressively WP/we scored an overall Page Speed Score of 93 (out of 100), and no high or medium priority recommendations were raised.
The following items were raised as low priorities:
Leverage browser caching
Remove query strings from static resources
Leverage browser caching
So beginning with 'Leverage browser caching'. The feedback states that
"Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network."
GPS (which turns out is a terrible acronym for the Google Page Speed site!) listed a few different files that aren't being cached by the browser, one of which was: http://blog.clock.co.uk/.../fradmcn-webfont.svg
With the assistance of Mike Cronnelly - we checked the virtual host, specifically looking at the mod_expires settings and we had:
logo.gif?v=1.0.3As you can see we didn't have a rule for svg files, so we now have a to-do item to revisit each site's caching criteria. A win for all sites - not just the blog. Teachers grade: B Teachers comment: Good effort, try that little bit harder
Minify CSS & JSUsually our deployments handle the minification of CSS, as obviously for code maintenance point of view, it can't be minimised until the last thing... however, as discussed we are using the WordPress system, so this is something we have ignored for the blog site - we could of course run the CSS include through a script that minifies it. We are usually pretty good at 'minifying' code where appropriate - so no real new learnings here, but obviously a reminder to keep on top of it. Teachers grade: A Teachers comment: Well done.
Remove query strings from static resourcesArgh! as discussed, we utilise resource versioning - however, this is now raised as an issue by GPS - as:
Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL.This raised some nice debate within clock, as we feel that by moving the version number parameter from the end of the file path (i.e.
logo.gif?v=@VERSION-NUMBER@) to something like:
/image/@VERSION-NUMBER@/logo.gifWe'd then simply be referencing a different file. But this does mean that our efforts to version resources and thus cache items, is actually bypassing a useful caching process implemented by large companies (proxy cache servers such as 'Squid'). A few more discussion about this I feel!! Teachers grade: ? Teachers comment: I might have to think about this too!
Specify a Vary: Accept-Encoding headerA new one on me:
The following publicly cacheable, compressible resources should have aA quick Google search for the rationale shows:
Bugs in some public proxies may lead to compressed versions of your resources being served to users that don't support compression. Specifying theI am not convinced that coding for bugs in proxies is a good tip - but further reading shows:
Vary: Accept-Encodingheader instructs the proxy to store both a compressed and uncompressed version of the resource.
TheUsually mod_deflate is used for our sites:
mod_deflatemodule sends a
Vary: Accept-EncodingHTTP response header to alert proxies that a cached response should be sent only to clients that send the appropriate
Accept-Encodingrequest header. This prevents compressed content from being sent to a client that will not understand it.
<Location /resource/> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/json ... </Location>
so it may be that we just haven't set in our conf correctly for the blog.
Teachers grade: B Teachers comment: Please use your sound knowledge across all projects.
That's all for now folks, maybe some more findings later on...
Big thanks to Mike Cronnelly, Ben Gourley, Jack Brewer and Tom Smith for their input.
Like what you've read?