Skip to content

Squid and Facebook

Lenny (Debian 5.0) and Lucid (Ubuntu 10.04 LTS) both ship with Squid 2.7 as their default Squid version.  If you plan on deploying squid as a web proxy in a modern mixed browser environment you should seriously consider Squid 3.0.  If you can’t (or, like me, you’d already spent some time getting Squid 2.7 set up just right) you are likely to find users reporting that Facebook is returning blank pages or that links within Facebook don’t work.  Looking at Facebook in a browser with debugging tools installed you’ll see lots of cross domain Javascript errors.

At this point you should either upgrade to Squid 3 (which doesn’t exhibit this behaviour) or make the following change to your squid.conf:

  • Add server_http11 on

Facebook uses different methods of shipping the Javascript depending on whether the client has made an HTTP/1.0 or an HTTP/1.1 request.  By default Squid 2.7 alters the request to be HTTP/1.0, so Facebook sends it’s fallback methods to the modern browser, which then proceeds to break.  The change above stops Squid rewriting that part of the request, ensuring that Facebook ships the right content to your users.