web performance optimization

Here are some resources for optimizing web performance. The primary goal is improving user experience by speeding up page load times and interactive latency, but this often also results in reduced bandwidth and lower server load.

Transport

SPDY

SPDY (pronounced speedy) is an open networking protocol developed primarily at Google for transporting web content. SPDY is similar to HTTP, with particular goals of reducing web page load latency and improving web security. SPDY achieves reduced latency through compression, multiplexing, and prioritization.”

It is being used as the basis for the upcoming HTTP/2.0

browser support

Recent versions of Chrome/chromium, firefox, opera, and msie all support it. Details listed here

apache2

Upstream apache module mod_spdy, code.google.com page

Debian RFP bug. Daniel Baumann took ownership of the bug in April 2012, but there hasn’t been any progress since then. It needs to be hijacked

nginx

SPDY/2 support introduced in 1.3.x dev branch.
SPDY/3.1 support added in 1.5.10 (Feb 4, 2014).

Module is ngx_http_spdy_module

So the 1.4.5-1 in jessie (and wheezy-backports) has SPDY/2.
1.5.10 isn’t currently in unstable yet (wishlist bug).

QUIC

There is also QUIC ( Quick UDP Internet Connections ) and is an attempt to improve low level transport (and works with SPDY). But it’s pretty new and so isn’t very well supported yet.

Compression

Web servers and clients these days are CPU rich but bandwidth poor. By compressing highly compressible content (text files, html, etc) we can reduce bandwidth and also speed up page load times.

Optimization of content

By optimizing content, like reducing size, combining requests to reduce overhead, and other tricks we can reduce bandwidth, latency, and speed up page load times.

Dynamic optimization of content

Ideally we’d optimize our content to speed things up, but sometimes we don’t have that choice, we don’t control the code or don’t have time to make the changes, or we don’t want to change the human readable code for some reason. Then we can use tools to automatically do it for us.

Google has written mod_pagespeed, a module (for both apache and nginx) that dynamically optimizes content on the fly to reduce bandwidth and latency, improve page load times, etc.

Caching

  • Apache 2.2 Caching guide, using mode_cache and mod_mem_cache or mod_disk_cache or mod_file_cache. Usually filesystem cache on Linux already gets you the best solution (since it spans processes, knows when things change, etc). There are a few cases (like proxing) where having apache cache helps, but it doesn’t make sense for most users.

Other Developer tools

  • Google Pagespeed Insights browser plugin
  • Yahoo has a nice analysis tool called YSlow with plugins for several browsers.
  • The Firefox plugin Firebug has some performance tools.