Caching for /js/index.php

Posted by GermanKiwi 

Advanced
March 09, 2014 02:06AM
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:

Quote

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.)
matt [ # ]
March 10, 2014 07:09AM
Thanks for the suggestion!

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

[github.com]



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

March 10, 2014 01:03PM
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)
Sorry, only registered users may post in this forum.

Click here to login

Free Forum support is provided by the Piwik Community. If you require any urgent or professional help, contact Piwik Professional Services team!