PDA

View Full Version : Safe to remove version numbers from .js?


final kaoss
05-01-2014, 09:06 PM
Any ill effects from removing the version number from the javascripts?

Go to:
Admin cp
Styles & Templates > Open the box
Search in templates

Search for Text: .js?v={vb:raw vboptions.simpleversion}
Replace with Text: .js
Test Replacement Only
(This will show you the results of doing this find/replace, without actually updating the templates) Tick NO
Click find until it's done.

I'd like others to test this out on a test skin/site and report any ill effects from it, thanks! It can help to prevent others from seeing version numbers to an extent and help with page loading.

I've done this and this issue is resolved for pretty much all js that I've seen so far.
Remove query strings from static resources (http://gtmetrix.com/reports/www.video-game-chat.com/aLaQ2Qe9)

tbworld
05-01-2014, 09:25 PM
Since it is used for browser cache busting, I would just alter the SIMPLE_VERSION constant in 'class_core.php' to something less revealing. If you run multiple sites with different versions, I would not change the CONSTANT to the same name for obvious reasons.

final kaoss
05-01-2014, 09:26 PM
Yeah it's kinda too late for that with my skin, I told it to do it for only one but it did it for every skin :). Would it break any js from working though?

tbworld
05-01-2014, 09:31 PM
Yeah it's kinda too late for that with my skin, would it break any js from working though?

Not that I am aware of.

It does not mean that some MOD out there is not using it for some odd reason, but I kind of doubt it. Most people are unaware what it is even for.

--------------- Added 01 May 2014 at 15:45 ---------------

Yeah it's kinda too late for that with my skin, I told it to do it for only one but it did it for every skin :). Would it break any js from working though?

This really will not hide the version number from too many people. Since they can view it in the JavaScript files. You would have to strip the version number from many of the JavaScript files. I am not sure if that would violate the licensing agreement with vBulletin.

Zachery
05-01-2014, 09:51 PM
Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:
Does this impact your servers? If not, why do you care?

K4GAP
05-02-2014, 06:09 AM
Yeah it's kinda too late for that with my skin, I told it to do it for only one but it did it for every skin :). Would it break any js from working though?

Has it affected anything that you can see? If not then you answered your own question. If it works fine for you then it ain't broke. If it ain't broke it don't need fixed.