I’ve been using, up to this point, MS Ajax Minifier for squashing and combining my CSS and JS. My servers set very far future expires headers so i need a cache expiry strategy. Currently I’m manually versioning these items by altering the filename so they expire on each release.
I’d like to automate this somewhat, specifically by appending the hash of the file contents onto the squashed file name. Bonus points if we can then update some config XML (that exists in a different project) file with this updated filename
We are using TFS build server, so I guess this should be wrapped in an MSBuild task? Or can i just have it run as a pre/post build project step?
Would very much appreciate if someone has any knowledge in this area that they are happy to share.
Thanks
Surely you could do it all from MSBuild:
Create one msbuild script containing:
1 – Ajax Minifier Manifest Task to do the squashing and combining.
2 – Hashing task. As you can see that’s c# code. Change the code to read the output folder set on step ‘1’ and change the name of the files, adding the calculated hash to each one.
Import the created msbuild script on your projects, or in your main build script, if you have one.