Can I compress and/or cache piwik.js?

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

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

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?

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