Caching for /js/index.php


#1

Hi, I’m using the WP-Piwik plugin for WordPress on my site, and I’m using the option for “js/index.php” rather than “piwik.js”.

However, I’ve found that when I test my site with YSlow, it reports this issue:

There is 1 static component without a far-future expiration date:
http://piwik.mysite.com/js/

But if I change the WP-Piwik plugin to use the option “Default tracking”, which means it uses http://piwik.mysite.com/piwik.js then I don’t get this issue with YSlow anymore - this file is correctly cached.

So it seems that the /js/ option doesn’t support being cached. I’m wondering if there is any way around this, so that I can use the /js/ option and still have it cached or given a far-future expiration date by my .htaccess file?

(The reason I want to use the /js/ option is to avoid browser-based privacy filters which attempt to block tracking.)


(Matthieu Aubry) #2

Thanks for the suggestion!

I fixed it and set 10 days caching for it, does it now pass the Yslow tests?


#3

Yup, that fixed it alright! YSlow no longer gives that error for it. Thanks!

I guess this will be added to the next release of Piwik right?

BTW you said you set it for 10 days of caching, but the number written in the two files you’ve modified is 100, not 10. I’m not sure if that means 100 days? (Just wondering)