This "cookie" law was passed in May 2011. As of 2012, web sites will need to comply. In preparation, we took some drastic measures. As a bonus, our web pages became a lot faster. Here's how.
A word from a sponsor:
Additional stuff to load
Like many other web sites, the OmegaJunior.Net aims to reach its readers, hopes to learn from their feedback, and likes its content to get shared via social media. We also want our content to get found, and we want to know which of our pages get read, and why.
As a result, we implemented analytics, social media sharing, page comments, and a search engine. We started out using third-party services for each: analytics by Google, social sharing via AddThis, page comments through Disqus, and search using Google CSE.
This worked... but it slowed down the web pages. Each web page now had to load coding, images, and other stuff, on top of its own content (and for a lot of pages, the time used by the Publizjr PPS to assemble the page in the first place).
Sizes of Added Loads
Google CSE: 300KB on average. Actual sizes depend on your configuration.
AddThis: 120KB, with the service detecting which media buttons to show, and us insisting it should show a Google Plus button.
Google Analytics: 30KB minimum.
Disqus: 100 - 200KB in the pre-2012 format.
Tools for measuring
Part of your browser: Google Page Speed, Chrome Speed Tracer, Firefox Timeline, MSIE Network.
Online: www.gtmetrix.com, loads.in.
Compliance = Road to Reduction
Move CSE away from your pages. Substitute a custom html form that sends search requests to a dedicated search results page. That page will then be the only one loading additional CSE stuff, which is fine because expected. The new privacy law stated that cookies and such, needed for specific functions requested explicitly by the reader, are fine. Search is one such function.
Complying to the law and reducing the add-ons doesn't come easy:
- We had to find cookie-free subtstitutes
- We had to develop an acceptable opt-in for readers
- Some subtitutes don't offer as rich a functionality (analytics for example)
- If you aren't using a CMS or PPS you'll be facing a lot of work
We took our measures to an extreme. Can't do much more than we did, without sacrificing even more functionality. Will our approach work for your web site, your company? Perhaps, perhaps not. We'd love to hear your thoughts.
Need problem solving?
Talk to me. Let's meet for coffee or over lunch. Mail me at “code at omegajunior dot net”.