Re: ModPagespeedMapProxyDomain and Google Analytics

36 views
Skip to first unread message

Bri Hatch

unread,
May 9, 2013, 11:01:13 PM5/9/13
to mod-pagesp...@googlegroups.com
On Thu, May 9, 2013 at 5:10 PM, barthoda <dan...@squixa.com> entreated:

> We notice that with empty browser cache testing that ga.js is commonly
> taking over a second to download, with this kind of response timing:
>
> Initial Connection: 363 ms
> Time to First Byte: 372 ms
> Content Download: 413 ms
>
> If it were proxied with ModPagespeedMapProxyDomain it would remove the
> connection time and perhaps be combined into other JS files.

Do not proxy ga.js, trust me.

ga.js should serve fast. It is served from far more Google
datacenters than Page Speed Service is, from a very fast
service that is built for serving static files exclusively
with low/no overhead. It should beat PSS which is dynamic
any day.

Additionally ga.js should have very cachable headers (24hr+),
allowing it to be served from local proxies if you've got them,
and you don't want to have the squid/etc proxies across the
internet storing multiple copies of it from different URLs
unnecessarily. Even if it's slow the first time, it's going
to stick in your browser cache. Since a bazillion pages are
instrumented with Analytics, the chance that your site is
the one where your browser happens to decide to load it is
small.

Lastly, it's loaded asynchronously, so your page is not blocked
by it.

If it is serving slowly currently (and it's not from what I see)
then I promise the appropriate Googlers are working on it.

You're not serving a copy of ga.js from your own domain, are you?
'cause that'd be bad.



--
Bri Hatch, Systems and Security Engineer. http://www.ifokr.org/bri/

Should "Seattle Ingress" group should be renamed to "As the
portal turns?" There is more drama in there than a daytime
soap opera, and I don't even need to deal with horrible acting.
--wizetux

Joshua Marantz

unread,
May 9, 2013, 11:10:43 PM5/9/13
to mod-pagespeed-discuss
One thing you should do is make sure you are using the asynchronous version of ga.js snippets.  mod_pagespeed can help you with that if it's not the case already:


-Josh




--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Bri Hatch

unread,
May 9, 2013, 11:13:37 PM5/9/13
to mod-pagesp...@googlegroups.com
At more or less Thu, May 9, 2013 at 8:10 PM, Joshua Marantz
<jmar...@google.com> enjoined:

> One thing you should do is make sure you are using the asynchronous version
> of ga.js snippets. mod_pagespeed can help you with that if it's not the
> case already:
>
> https://developers.google.com/speed/docs/mod_pagespeed/filter-make-google-analytics-async

Yes yes yes, use the async version.

--
Bri Hatch, Systems and Security Engineer. http://www.ifokr.org/bri/

Dave: I thought we were going to fix that.
Kevin: We did. Twice.
Reply all
Reply to author
Forward
0 new messages