evylang / todo

0 stars 0 forks source link

Add content hashes to frontend filenames #45

Closed juliaogris closed 8 months ago

juliaogris commented 9 months ago

Following best caching strategies for static frontend assets, it seems we should cache expiry to a maximum and have frontend resources have content hash in their filename for JS and CSS files.

Import maps will make it easy to avoid import statement update and only automate the update of the import map. We will probably need some scripting similar to URL/href rewriting in the firebase-deploy script. We will also have to set the cache expiry of certain resources to the maximum in the firebase configs.

Which hashing algorithm to use remains to be seen. IMO it'd be amazing to use short hashes, backed by full length sha256 or similar and only increase the length of chars used on hash conflict like git. This would require tracking/logging of previously used hashes and might end up being to complicated, to be seen.

juliaogris commented 8 months ago

This has mostly been done with additions to firebase-deploy, though @camh- is working on a proper, more robust version written in go that allows for cash busting in sub-directories.

firebase-deploy script changes were merged with evylang/evy#240 .