Autoversioning CSS/JS in ASP.NET MVC?

So I was reading this stackoverflow post about "autoversioning" in ASP.NET MVC for CSS/JS files and was wondering what the "best" strategy is to do this.

The solution provided inserts an assembly number - which means everytime you publish - it will change EVERY SINGLE file which is not ideal because if you make modifications to just 1 *.css or *.js then it will change each and every file.

1) How can it be done just for "single files" instead of using site wide assembly using modification date or something on IIS7 ?

2) Also if I have some sort of "static" asset like - http://static.domain.com/js/123.js - how can I use rewrite to send the latest file for a request if someone has integrated this static link onto their site ?

i.e. http://static.domain.com/js/123.js is the link and when a request comes for this - check and send latest file ?

14
задан Community 23 May 2017 в 12:10
поделиться