MyBB Community Forums

Full Version: Query string at the end of a JS inclusion
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm looking at my MyBB headerinclude template, and I always wonder why there's an ?ver=1400 at the end? Where is it used in the code?

I just wonder this because all kinds of performance tests say that it should be avoided. And I am the type of guy who would try to shave off 1/10th of a second of load time.
It's just used to show when that script was last updated I believe. Feel free to delete it as it does nothing anyway.
It's an easy way to break the cache when we update the javascript files so the browser recaches them.
I see... That makes sense.

Since it does that Nathan, would it be safe to delete, or would I encounter issues after an upgrade?
(2012-06-24, 08:19 PM)Josh H. Wrote: [ -> ]I see... That makes sense.

Since it does that Nathan, would it be safe to delete, or would I encounter issues after an upgrade?

Deleting it would be fine, because the upgrade would add a new one.
That's true.
Would it? Is it not referenced in templates? I thought they were persistent through updates?
(2012-06-25, 08:14 AM)Tom K. Wrote: [ -> ]Would it? Is it not referenced in templates? I thought they were persistent through updates?

I'm not sure, I can't say I've looked recently. If I remember rightly though, they're hardcoded into the template... either way, you'd always be able to edit it to something else if people complain about issues with it following an update.
(2012-06-24, 11:26 PM)Charlie Hadden Wrote: [ -> ]
(2012-06-24, 08:19 PM)Josh H. Wrote: [ -> ]I see... That makes sense.

Since it does that Nathan, would it be safe to delete, or would I encounter issues after an upgrade?

Deleting it would be fine, because the upgrade would add a new one.

since the cache is based on filename only, adding the version at the end forces an update once the software has been updated.
But if users delete their browsers cache, they should then see the new javascript file. So there is not a big deal at the end, if nobody complain at least.
Pages: 1 2