angular-google-analytics icon indicating copy to clipboard operation
angular-google-analytics copied to clipboard

Override scriptSource for setting up Expires or Cache-Control headers

Open sqrter opened this issue 7 years ago • 0 comments

Hi,

There's a common issue while optimizing Google PageSpeed insights score. The thing is that https://www.google-analytics.com/analytics.js is delivered with cache-control:public, max-age=7200 header which is only 2 hours. Though, recommended value is at least 1 week (https://developers.google.com/speed/docs/insights/LeverageBrowserCaching), so to get rid of the warning that PageSpeed insights generates and probably to increase it's score we have to deliver own copy of analytics.js or just proxy calls to www.google-analytics.com setting up needed headers for client-side caching.

Therefore it would be nice to have the domain as an optional parameter instead of herd coded string.

sqrter avatar Feb 27 '17 16:02 sqrter