6 votes

Why is there guid-like parameter when requesting js or css?

Hi, I looked through JS files and I noticed that all JS and CSS are called with weird parameter. tildes.css?aadf6c54 tildes.js?e6d30b42 third_party.js?4393e99 (I changed the string after ?)

Does anyone know why is it done and what does it mean?

6 comments

  1. [6]
    Deimos
    (edited )
    Link
    That's usually referred to as a "cache buster": https://www.keycdn.com/support/what-is-cache-busting It lets me tell browsers that they can download the static files once and never need to...

    That's usually referred to as a "cache buster": https://www.keycdn.com/support/what-is-cache-busting

    It lets me tell browsers that they can download the static files once and never need to re-download them. When I change one of those files, the cache buster string also changes, and the browser will recognize that the filename changed and download the new version (once).

    16 votes
    1. [3]
      Adys
      Link Parent
      Fun tip (for you or anyone else), if you make the filename content-addressable in some way (eg. static/css/main-$sha256OfContent.css), Cache-Control: immutable (documentation) makes a lot of sense...

      Fun tip (for you or anyone else), if you make the filename content-addressable in some way (eg. static/css/main-$sha256OfContent.css), Cache-Control: immutable (documentation) makes a lot of sense to use and is a lot more aggressive than usual cache control methods such as bare max-age (will prevent even the initial request).

      9 votes
      1. [2]
        Diff
        Link Parent
        Looks like that has horrible browser support though. Chrome and its mountain of children don't support it on Desktop, and nobody but Safari supports it on Mobile.

        Looks like that has horrible browser support though. Chrome and its mountain of children don't support it on Desktop, and nobody but Safari supports it on Mobile.

        7 votes
        1. Adys
          Link Parent
          Yep, it's very recent. I just checked the compatibility table and it's worse than I imagined, but other browsers will just ignore it if they don't support it afaik. I'm looking forward to better...

          Yep, it's very recent. I just checked the compatibility table and it's worse than I imagined, but other browsers will just ignore it if they don't support it afaik.

          I'm looking forward to better support for it though, it's one of those things that makes a ton of sense which we don't have on the web, despite having a mountain of other obscure features.

          7 votes
    2. [2]
      elfox
      Link Parent
      We really need a save feature so we can save comments like this. This is something I'm going to refer back to quite a bit this is cool.

      We really need a save feature so we can save comments like this. This is something I'm going to refer back to quite a bit this is cool.

      4 votes