Can I compress and/or cache piwik.js?


#1

Google (PageSpeed Insights) is recommending I compress piwik.js and have it cached via Cache-Control headers. Is this safe to do?


(Matthieu Aubry) #2

Yes it’s safe. We recommend to cache it for max 7 days. Cheers


#3

I’m trying to compress it in nginx according to its MIME type but it isn’t working according to Google.

gzip on;
gzip_disable msie6;
gzip_types text/javascript application/x-javascript text/css;

Any idea what could be wrong there?


#4

I just needed to add application/javascript to the list.