Files always get invalidated on WebGL when must-revalidate is used

 if (url.match(/\.data/) || url.match(/\.bundle/)) {
          console.log("cacheControl returning must-revalidate for url: ", url);
          return "must-revalidate";
        }

When I use “must-revalidate”, or leave the cache control config as default, the “.data” and “.bundle” files always get invalidated and redownloaded again. It only uses the cache when I change it to "immutable:.
The etag and last-modified header have the same values.

The cache control response header from my server for these files is: “public, max-age=1296000, no-cache”
So, is this an issue with my server headers or is it a webgl thing?

Also can you please give me a source to understand how Unity WebGL cache works? for example how “must-revalidate” knows that the file was changed? does it have a lifetime or not?

Here is the game: tuxul.com

1 Like

and does unity ask the WebGL cache for the files before making a request? (Which leave it to the browser). because when I set it to immutable, there is no web request at all.

HEYY, ANY IDEA?

Unity WebGL’s cache function uses IndexedDB.

It seems like it’s Unity’s problem since this consistent across all browsers.