I Turned On HTTP/2 (SPDY) Today…

This morning I had NatNet install mod_spdy on my server today. That enables what’s called HTTP/2 – which speeds up SSL-based websites through more intelligent requests and responses. In short instead of handling one thing at a time in a queue, it handles everything at once. It’s supported by pretty much all of the major browsers. I’ve read about it for a while now, the article I read this morning that finally got me to act was this one…

http://moz.com/blog/http2-a-fast-secure-bedrock-for-the-future-of-seo

I’ll have to wait for a day or two and look at the page speed analysis in Google Analytics to see how much it helped.

One caveat though… I had instructions in my .htaccess files that were problems when mod_spdy was turned on. Specifically you can’t have lines like this:

RewriteCond %{HTTPS} !=on

The HTTPS variable/flag is set by mod_ssl (or whatever you’re using to serve pages with SSL). Since it’s not set by mod_spdy it creates an infinite loop of redirects so you have to change all those directives to:

RewriteCond %{SERVER_PORT} ^80$

So you’re changing it from “If SSL is not on” to “If request is on port 80” (the non-SSL port).

I’ll let you guys know if I see much of a difference in page speed. Hopefully it will help.

Oh, and this only works on sites with SSL. If you’re not running SSL installing mod_spdy will accomplish nothing AFAIK.

Re: I Turned On HTTP/2 (SPDY) Today…

You are brave that’s for sure. Forever testing new things. But you have seen good results from all this experimentation though, haven’t you? Do think all these tweaks, with speed and SSL have resulted in more traffic?

Re: I Turned On HTTP/2 (SPDY) Today…

My mod_spdy got turned off :frowning:

Apparently it was causing segfaults. It’s a known, but obscure problem. No one knows yet what’s causing it.

There were two full days that it was on. Page load times were lower than average, but not all that low.

I think the reason is because I’ve sharded things – banner ads are served off one domain, the page source off the primary domain, some stuff is loaded off Google, etc. So bottom line, you sort of have to rethink how you serve content with SPDY.

Since it didn’t make too much difference, I’m not all that sad that it was disabled.

Screen Shot 2014-12-16 at 11.22.40 AM.jpg

Re: I Turned On HTTP/2 (SPDY) Today…

FYI, a little more about mod_spdy…

Google warns that you should be running mod_fcgid instead of mod_php since mod_spdy requires a completely thread safe environment. My server is running mod_php5, and from what I read the change to mod_fcgid is ‘non-trivial’. AND since mod_spdy is considered beta software, hosts like NatNet refuse to support it. So I’m just forgetting about SPDY for the moment.

BUT the Apache Foundation is planning on releasing a (non-beta) version of mod_spdy for Apache 2.4. Once that comes out, and NatNet supports Apache 2.4 (they just upgraded me last month to the latest version they support and it was only 2.2.22), then I’ll revisit mod_spdy.

In the meantime I’ll work on being able to easily switch to a less sharded architecture so when I finally get to use SPDY again, I’ll see bigger speed improvements.