--
It will work out of the box ;)
(Sent from smart phone, can't properly cite)
Hi,It might help to have a close look at your requirements and see if you can cut corners, there. Two easier solutions that are not as functionally complete but that will do the job:- Pre-compute the hashes, create symlinks with the new names (e.g. make fingerprints)
- Put your app behind a webserver and create a URL matching rule for hashes that strips the hash and serves the bare fileIf you wrap all references to static files in a function (as you do now) it will make it easier to also change the host they are served from: {{cdn "myfile.png"}} -> //blabla.cloudfront.net/myfile-somehash.png", for example. Even if you do not have a CDN, this will make it easy to use a webserver only for your static files, which, in turn, makes dealing with this specific case much easier.The nice thing about using hashes is that it relies solely on the contents of the file. Timestamps or versioning requires extra bookkeeping and can get confusing if you have multiple locations you serve your static content from.If possible, try to add an extra hint in the filename, not just the hash. E.g.: myfile.png -> myfile-md5-d41d8cd98f00b204e9800998ecf8427e.png. This helps identifying the hash when you have just the requested resource. Useful when using regular expressions for URL rewrite rules, or find rules.
Greetings,Hraban