I’ve heard twice this week that TailRank was ’slow’. It’s certainly not my fault. TailRank makes extensive use of caching. The home page is literally sitting there in memory waiting to be dumped out over the wire.
The problem is Google Analytics. The JavaScript I need to run is on a remote server and most browsers will block until that remote Javascript is fetched. This usually means the page blocks on DNS and a new HTTP connection to a new server. Evil.
According to the Urchin’s settings page I need to put this in my head element.
I think this is required so that they can intercept events before the page is being loaded. If they didn’t it could mean that a person could click on a URL before the page is loaded which would yield incorrect statistics. My guess is that this is a non-trivial percentage of web traffic (say 10%).
I have the same problem with Sitemeter as well. Expect this trend to continue.
A temporary solution is just to download the urchin.js file and store it on my web server. Hopefully this will work but if they want to push out any updates I certainly won’t benefit from them.
What would be killer is a mod_rewrite (or mod_proxy) rule which could fetch the page for the first time and then do updates asynchronously. Users would always get the cached page. This way if Google pushes out an update I don’t have to think about it and my users don’t have to be penalized for latent DNS and HTTP 1.1 connection issues.












January 9, 2006 at 8:50 pm
Use mod_proxy, mod_cache, and mod_disk_cache..
CacheRoot /var/tmp/httpd-cache
ProxyPass /foo.js http://exmaple.com/foo.js
ProxyPassReverse /foo.js http://exmaple.com/foo.js
CacheEnable disk /foo.js
Might want to tweak the CacheDefaultExpire, CacheIgnoreCacheControl commands too…
http://httpd.apache.org/docs/2.2/mod/mod_cache.html
January 9, 2006 at 8:55 pm
Oh, this won’t do async-refetches, but if you added mod_cache_requester, it would:
http://sourceforge.net/projects/cache-requester
January 9, 2006 at 11:31 pm
Haven’t looked @ Google Analytics, but I use an install of Urchin5 and I just move the __utm.js down to the bottom of the page to get around it a bit. But that’s when it’s served from the same server and not going across the net to get it.
Careful with trying to cache it, because as you probably realise it’s those requests to the remote system that it needs to know what’s going on.