Best algorithm to cache static assets

Viewed 99

Caching static assets is done by using hash algorithms (sha1, sha256, md5...), the result of which is appended to the file name (for cache busting).

Npm modules are using different algorithms by default like gulp-hash (sha1), object-hash (sha1), webpack (md4), grunt-hash (md5)...

Caching assets being based on file's content and not on randomness (where randomBytes would be choosen), in a node.js web server context, which algorithm has the best collision / speed ratio to be acceptable to produce cached assets ? Is md5 not enough ?

0 Answers
Related