awesomemotive / all-in-one-seo-pack

All in One SEO plugin for WordPress SEO
https://aioseo.com
339 stars 155 forks source link

Add query string to autotrack.js #3176

Closed Garconis closed 4 years ago

Garconis commented 4 years ago

Currently, if/when using the "Track Outbound Links" option for Google Analytics settings, it's loading the tracking JS file like:

https://example.com/wp-content/plugins/all-in-one-seo-pack/public/js/vendor/autotrack.js

But if a new version is released, it still uses the same filename. So it could cause the old file to be stuck in the browser cache. Especially if we set the browser Cache-Control to something like 1 year... or even 10 years.

If there is a new version released with a plugin update, then the browser will still be pulling in the old version if it was cached for the user. They wouldn't get the new version because of the long browser cache.

Therefore, to help "bust" the browser cache, it would be ideal to add a query string to the JS files. Maybe based on the plugin version. This way, the browser will see it as a new file if/when it truly is updated.

For example:

https://example.com/wp-content/plugins/all-in-one-seo-pack/public/js/vendor/autotrack.js?ver=3.5.4

wpsmort commented 4 years ago

@Garconis Thanks for reporting this. We'll add version numbering in the next release due out soon.

wpsmort commented 4 years ago

This will be included in the v3.6 release which is due for release this week.