Instant Pages vs Instant Web?

Again an interesting ALA-article about web performance (or the lack thereoff), triggered by Facebook’s “Instant Articles” announcement;

I think we do have to be better at weighing the cost of what we design, and be honest with ourselves, our clients, and our users about what’s driving those decisions. This might be the toughest part to figure out, because it requires us to question our design decisions at every point. Is this something our users will actually appreciate? Is it appropriate? Or is it there to wow someone (ourselves, our client, our peers, awards juries) and show them how talented and brilliant we are?

This exercise clearly starts at the design-phase, because thinking about performance in development or testing-phase is simply too late.

Is your string zipped?

While looking into a strange issue on a multisite WordPress installation which optimized the pages of the main but not of the sub-blogs, I needed code to check whether a string was gzipped or not. I found this like-a-boss code-snippet on StackOverflow which worked for gzencoded strings:

$is_gzip = 0 === mb_strpos($mystery_string , "\x1f" . "\x8b" . "\x08");

But this does not work for strings compressed with gzcompress or gzdeflate, which don’t have the GZIP header data, so in the end I came up with this less funky function which somewhat brutally simply tries to gzuncompress and gzinflate the string:

function isGzipped($in) {
  if (mb_strpos($in , "\x1f" . "\x8b" . "\x08")===0) {
    return true;
  } else if (@gzuncompress($in)!==false) {
    return true;
  } else if (@gzinflate($in)!==false) {
    return true;
  } else {
    return false;

Klunky, but it works. Now if only this would confirm my “educated guess” that the original problem was due to a compressed string.

Music from Our Tube: LA Priest – Oino

Heard “Oino” yesterday very, very early in the morning (around 6h20, while making my lunch-sandwiches, actually) on Studio Brussel and immediately loved the clickety clackety percussion-driven weird funk-like feel to it;

LA Priest – Oino (Official Video)

Watch this video on YouTube or on Easy Youtube.

Did some web-digging and learned Samual Eastgate (aka Sam Dust), the guy behind LA Priest, was also in Late of the Pier, so guess I’ll have to go listen to them as well.