<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Speed Up Google Analytics, use local ga.js</title>
	<atom:link href="http://www.askapache.com/linux-unix/ga-urchin-speed.html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com/linux-unix/ga-urchin-speed.html</link>
	<description>Web Development</description>
	<pubDate>Mon, 12 May 2008 11:21:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Barry Hunter</title>
		<link>http://www.askapache.com/linux-unix/ga-urchin-speed.html#comment-35608</link>
		<dc:creator>Barry Hunter</dc:creator>
		<pubDate>Fri, 01 Feb 2008 15:47:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/linux-unix/ga-urchin-speed.html#comment-35608</guid>
		<description>Thanks for the responce, 

&#62; The google-analytics.com servers are configured to return a random Last-Modified date EVERY single time a browser requests http://www.google-analytics.com/ga.js 

It validates for me here tho (tried it three times)
http://www.ircache.net/cgi-bin/cacheability.py

Its probably just that different datacenters have slightly different versions of the file, so sometimes you hit one, sometimes another? (another common problem with etags)
- so if that is the case then it is rather a shot in the foot - both for Google, and visitors to sites with GA. 

They do also have a 'max-age', so most of the time the browser wont even bother with the conditional get. 

&#62; your browser has to follow up the 304 If-Modified-Since request with a FULL GET request, 
I thought it was a 'conditional get', 'Ive got this file, if it matches this date dont bother sending it', so if the dates match server returns 304, otherwise 200 and the new content. 

&#62; Also don't forget about HTTP/1.1 ability to use persistant connections. 
Ah of course! Although I know have tended to disable it on high traffic sites, lots of clients maintaining connections, eats up apache threads, siting around doing nothing. Having lots of threads in the cache ready means minimum startup time on each connection, and the overall server performance is better - of course there may be some other apache setting to help with this - or for small sites is perfectly good.</description>
		<content:encoded><![CDATA[<p>Thanks for the responce, </p>
<p>&gt; The google-analytics.com servers are configured to return a random Last-Modified date EVERY single time a browser requests <a href="http://www.google-analytics.com/ga.js" rel="nofollow">http://www.google-analytics.com/ga.js</a> </p>
<p>It validates for me here tho (tried it three times)<br />
<a href="http://www.ircache.net/cgi-bin/cacheability.py" rel="nofollow">http://www.ircache.net/cgi-bin/cacheability.py</a></p>
<p>Its probably just that different datacenters have slightly different versions of the file, so sometimes you hit one, sometimes another? (another common problem with etags)<br />
- so if that is the case then it is rather a shot in the foot - both for Google, and visitors to sites with GA. </p>
<p>They do also have a &#8216;max-age&#8217;, so most of the time the browser wont even bother with the conditional get. </p>
<p>&gt; your browser has to follow up the 304 If-Modified-Since request with a FULL GET request,<br />
I thought it was a &#8216;conditional get&#8217;, &#8216;Ive got this file, if it matches this date dont bother sending it&#8217;, so if the dates match server returns 304, otherwise 200 and the new content. </p>
<p>&gt; Also don&#8217;t forget about HTTP/1.1 ability to use persistant connections.<br />
Ah of course! Although I know have tended to disable it on high traffic sites, lots of clients maintaining connections, eats up apache threads, siting around doing nothing. Having lots of threads in the cache ready means minimum startup time on each connection, and the overall server performance is better - of course there may be some other apache setting to help with this - or for small sites is perfectly good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/linux-unix/ga-urchin-speed.html#comment-35607</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Fri, 01 Feb 2008 15:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/linux-unix/ga-urchin-speed.html#comment-35607</guid>
		<description>@ Barry~

Your logic is correct but unfortunately google throws a wrench into it.  For unknown reasons, &lt;em&gt;at least I can't figure it out&lt;/em&gt;, The google-analytics.com servers are configured to return a random &lt;code&gt;Last-Modified&lt;/code&gt; date EVERY single time a browser requests &lt;code&gt;http://www.google-analytics.com/ga.js&lt;/code&gt;  which of course means that ga.js CANNOT be cached by any browser.  Therefore, every time a browser loads a page that includes the ga.js file from google, it has to make a 304 If-Modified-Since request to see if the file has changed.

Because google returns a different Last-Modified date EVERY single time, your browser has to follow up the 304 If-Modified-Since request with a FULL GET request, meaning it has to re-download the entire file, for every single page load.

This is wayyyyyyyyyyyyyyyyyyyy slower than hosting it on your own server, for obvious reasons. 

Of course, hosting it on your own server wouldn't be much faster UNLESS you implement server-side caching, which I take full advantage of on AskApache.com, so, my site loads much faster in regards to ga.js.

Also don't forget about HTTP/1.1 ability to use persistant connections.  Basically this means that when a client/browser requests &lt;code&gt;http://www.askapache.com/linux-unix/ga-urchin-speed.html&lt;/code&gt;, it caches the reverse DNS for askapache.com, and opens a persistant connection to my server.  So, followup requests for additional resources like images, css files, js files, etc.. all happen using the same connection, which equates to speed.  

So If a client already has a persistant connection to my server, and If I have solid caching set up on my server, and If I want my site to be faster, I will host ga.js locally.  When google changes their caching policy, then of course it will be faster to NOT host ga.js locally, and your suggestions will be absolutely correct.</description>
		<content:encoded><![CDATA[<p>@ Barry~</p>
<p>Your logic is correct but unfortunately google throws a wrench into it.  For unknown reasons, <em>at least I can&#8217;t figure it out</em>, The google-analytics.com servers are configured to return a random <code>Last-Modified</code> date EVERY single time a browser requests <code><a href="http://www.google-analytics.com/ga.js" rel="nofollow">http://www.google-analytics.com/ga.js</a></code>  which of course means that ga.js CANNOT be cached by any browser.  Therefore, every time a browser loads a page that includes the ga.js file from google, it has to make a 304 If-Modified-Since request to see if the file has changed.</p>
<p>Because google returns a different Last-Modified date EVERY single time, your browser has to follow up the 304 If-Modified-Since request with a FULL GET request, meaning it has to re-download the entire file, for every single page load.</p>
<p>This is wayyyyyyyyyyyyyyyyyyyy slower than hosting it on your own server, for obvious reasons. </p>
<p>Of course, hosting it on your own server wouldn&#8217;t be much faster UNLESS you implement server-side caching, which I take full advantage of on AskApache.com, so, my site loads much faster in regards to ga.js.</p>
<p>Also don&#8217;t forget about HTTP/1.1 ability to use persistant connections.  Basically this means that when a client/browser requests <code><a href="http://www.askapache.com/linux-unix/ga-urchin-speed.html" rel="nofollow">http://www.askapache.com/linux-unix/ga-urchin-speed.html</a></code>, it caches the reverse DNS for askapache.com, and opens a persistant connection to my server.  So, followup requests for additional resources like images, css files, js files, etc.. all happen using the same connection, which equates to speed.  </p>
<p>So If a client already has a persistant connection to my server, and If I have solid caching set up on my server, and If I want my site to be faster, I will host ga.js locally.  When google changes their caching policy, then of course it will be faster to NOT host ga.js locally, and your suggestions will be absolutely correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barry Hunter</title>
		<link>http://www.askapache.com/linux-unix/ga-urchin-speed.html#comment-35452</link>
		<dc:creator>Barry Hunter</dc:creator>
		<pubDate>Wed, 30 Jan 2008 12:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/linux-unix/ga-urchin-speed.html#comment-35452</guid>
		<description>I've seen things like this suggested before (non Analytics), but this is assuming you have global connectivity better than Google. On the whole your server might be closer to you, but its quite possible Google have a datacenter closer to many of your visitors. 

On a remote server in the UK (so no local user to prime the DNS), from Google takes, 0.7s, but from yours 1.7s then once the DNS has been primed, 0.4s from Google and then 0.8s from your z. server. 

Also this negates caching in some cases as its quite possible a user has the file loaded from visiting a another website, upon visiting your site they have to download it again. 

Save yourself the bother of maintaining it, and the bandwidth and let Google host it, I say :)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve seen things like this suggested before (non Analytics), but this is assuming you have global connectivity better than Google. On the whole your server might be closer to you, but its quite possible Google have a datacenter closer to many of your visitors. </p>
<p>On a remote server in the UK (so no local user to prime the DNS), from Google takes, 0.7s, but from yours 1.7s then once the DNS has been primed, 0.4s from Google and then 0.8s from your z. server. </p>
<p>Also this negates caching in some cases as its quite possible a user has the file loaded from visiting a another website, upon visiting your site they have to download it again. </p>
<p>Save yourself the bother of maintaining it, and the bandwidth and let Google host it, I say :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- In 0.763 -->
