Removing hard-coded cookies from ExpressionEngine

A client is using ExpressionEngine 2 as just a CMS and not using its membership features, and we're doing everything we can to improve performance, both back-end and front-end.

On the front-end side, the cookie setting takes up some of the precious bytes that get transferred before the browser can start downloading assets.

I have turned off everything I can turn off that adds cookies to ExpressionEngine's output, but there were still two cookies hard-coded into the output even for logged-off users: exp_tracker and exp_last_activity.

The code that does this is in expressionengine/libraries/Session.php:
  • $this->EE->functions->set_cookie('tracker', serialize($tracker), '0');
  • $this->EE->functions->set_cookie('last_activity', $this->EE->localize->now, $expire);
This was a bit tricky to find, and I didn't see answers on Google, so there it is for posterity.

Note that EllisLab staff says making this change "can affect your ability to upgrade, and your ability to receive support." They also point out that you would need to re-apply such changes after an upgrade.

Web performance

Several of my clients have asked me to do performance tuning for their websites. I find it fascinating work, and rewarding to deliver improvements that help machines serve humans rather than the other way around.

I'll try to post nuggets of value as I come across them, regardless of whether they seem basic or advanced to me.

A great one to start with this first day is WebPagetest. It loads a page with an empty cache, then a filled cache in one of many browsers and produces amazingly detailed reports.

I have been doing a lot of tuning on one of my clients' sites, but mostly through my own Mac Chrome on a pretty fast connection. I had WebPagetest run the site on IE8 on a slower connection and got quite an education.

OO programming in JavaScript, neatly summarized

This article from Douglas Crockford outlines the basics and feel of programming with objects in JavaScript very succinctly.