ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
86 stars 83 forks source link

pass file name to customHash function? #57

Closed kbullaughey closed 9 years ago

kbullaughey commented 9 years ago

I found a handy use for customHash, which is to force a hard-reset of the hashes. My use case was wanting to invalidate cloud-front caches so that I could get new Origin headers necessary for a domain name change. By defining a customHash function that just added an extra version string to the end of the content and then doing the usual md5 hash, I now have a way to force a hard-reset of all hashes by incrementing this version.

However, it would be nice if the file name was also passed to the customHash function so that one could more intelligently decide how to hash the content. In my use case, this would allow me to only reset the cache for a certain file or subset of files.

Would this be a straightforward fix. Is there appetite for it?

briangonzalez commented 9 years ago

Simple: https://github.com/rickharrison/broccoli-asset-rev/pull/58

kbullaughey commented 9 years ago

Great!