Dealing with multiple cached Javascript files

129 Views Asked by At

I recently pushed a new version of my websites Javascript code, which caused CSS and JS media not to be loaded. In the case of Chrome, the requests were stalled due to a 6 request per domain/origin limit.

In the aftermath of resolving this, I am now experiencing users triggering remote requests multiple times per second.

I believe that there are multiple cached copies of the JS files which listen on the same DOM element and events.

If I am right, as a development, how do I detect multiple cached versions and clear it without user intervention?

I am using Rails 4 (Turbolinks enabled) to compile and minify my assets. As far as I'm aware, I should not be having these issues.

Regards,

1

There are 1 best solutions below

0
David Milanese On

It turns out that Turbolinks was triggering the "on load" event multiple times on each page visit. I've since removed Turbolinks :(