What does ?12345 query string after the Javascript reference do?

Hi folks,

Started using Hype last week and absolutely loving it.

I’m using Grav CMS for my site. One of the nice things about it, is the ability to easily group and minify all the JS into a single link.

However, this code doesn’t allow for the ?12345 (random) number that follows the Javascript call:

/hype/browser.hyperesources/browser_hype_generated_script.js?12345

I removed it and everything seems to work. Just curious then, what does the ?12345 actually do, is it important, or is it to prevent caching during production?

Many thanks and all the best. Keep up the great work Tumult.

Stephen

1 Like

Glad you're loving Hype!

Yup that's it.

That is a 'query string'. It protects against this situation:

  • Your server caches Javascript content for a period of X days
  • You update your Hype document by re uploading your .js file to your server
  • When reloading your Hype document, your server tells the browser 'don't re download this file'.

Having the query string in place ensures that the browser considers this file fresh -- the file is redownloaded each time someone loads your web page. If you find that reloading your page does not reflect your changes, you can either add that string back in, or change the filename of your Hype generated JS file.

5 Likes

Cool, thanks Daniel. Much appreciated!