How the European Privacy Law Sped Up my Web Pages - ΩJr. Software Articles and Products

This information lives on a web page hosted at the following web address: 'https://www.omegajunior.net/code/'.

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:


Implementing static social sharing, a custom search box, a "accept terms" button for page comments, and dropping client-side analytics, drastically reduced the amount of stuff to load with each page request. This upped my page speed from a 73% average to a 92% avg. (A CDN improved that to 98% for some pages.)


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.

Throw out AddThis and replace it with static social sharing buttons. No javascript, no iframes, just html and css (and in our case, a negligible amount of php programming).

Get rid of Google Analytics and any other kind of javascript-based tracking and tracing tools. Use server-based statistics instead. Since the OmegaJunior.Net is distributed on the CDN (Content Delivery Network) provided by Cloudflare, we look at their statistics, too.

Put Disqus on hold and load it only after the reader presses an "accept" button, explicitly accepting the use of cookies and other storage methods, that perhaps can be used to track them.


Redux Drawbacks
Complying to the law and reducing the add-ons doesn't come easy:



Afterthoughts
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”.