0

ON a WordPress site, a plugin that I am using makes use of, jquery.cookie.js. My hosting provider makes use of mod_security prevented jquery.cookie.js from being server and resulted in error 406.

As I looked at the failure in the Chrome development tools network log, I saw that the line in questions was,

http://neuron-tech.ca/wp/wp-content/plugins/soldpress/lib/jquery.cookie/jquery.cookie.js?ver=1.3.1 all in bold red.

The solution was to contact the hosting provider and they modified the mod_security rule for this on my website.

As I looked at the other JavaScript files in the Network log, they all had ".js/?" followed by the version of the JavaScript code.

Why is this done, what is the purpose of adding the version number after the "?"? If I do it, I end up with the JavaScript in the browser as plain text. Is this some kind of technique to verify thta the JavaScript has successfully been served?

Richard
  • 261
  • 1
  • 3
  • 9

1 Answers1

1

Appending a ? to a JavaScript (or CSS or Image, ...) file has nothing to do with modsecurity.

It is done to "bust" the browser cache, i.e. to force the user's browser to load a new version of a file of the same name (apart form the 'ver'-parameter) and not reuse the one from the cache.

Also see: Cache busting via params

Community
  • 1
  • 1
Ronald
  • 2,864
  • 3
  • 25
  • 36