Name Files As Hashes improvement and how to customize better custom webGLTemplates

Hi there!

The “Name Files As Hashes” option works well, but it generates a new file with every build. This can be inconvenient because it requires clearing the folder if we don’t want to keep previous versions.

If I uncheck this option, the issue is that some content gets cached by the browser, making it uncertain whether the latest version is being loaded.

Instead, is there a way to customize the URL like this?

dataUrl: buildUrl + "/{{{ DATA_FILENAME }}}?ver={{{ DATA_HASH }}}",

I know I could use this:

dataUrl: buildUrl + "/{{{ DATA_FILENAME }}}?ver={{{ PROJECT_VERSION }}}",

But I was hoping for something more automatic. Another idea might be to use the build’s date and time to generate the version string but such variables doesn’t seems to exists inside a custom template as stated here Unity - Manual: WebGL templates.

Unfortunately, I don’t see a way to make C# calls in the WebGL custom template.
Does anyone have ideas on how to improve this?