Auto-versioning in ASP.NET MVC for CSS / JS Files?

前端 未结 4 967
礼貌的吻别
礼貌的吻别 2020-12-08 00:09

I have read lots of article on how to auto-version your CSS/JS files - but none of these really provide an elegant way to do this in ASP.NET MVC.

This link - How to

4条回答
  •  既然无缘
    2020-12-08 00:23

    I usually append a fake query string to my resource files.. i.e

    
    
    

    It doesn't require any url helpers and works no matter what's running the in background. To be honest I haven't throughly tested this method, but I've found it always fixes any resource caching issues people were experiencing.

    You'd probably have to update the v= manually, but it wouldn't be terribly hard to append a version parameter to the resources from a config file somewhere.

    Edit:

    I went back and throughly read through the content of the link above and realize you've probably already discarded this method. Apologies for suggesting it again.

提交回复
热议问题