How can I force clients to refresh JavaScript files?

后端 未结 26 2269
旧时难觅i
旧时难觅i 2020-11-22 03:40

We are currently working in a private beta and so are still in the process of making fairly rapid changes, although obviously as usage is starting to ramp up, we will be slo

26条回答
  •  再見小時候
    2020-11-22 04:22

    Cache Busting in ASP.NET Core via a tag helper will handle this for you and allow your browser to keep cached scripts/css until the file changes. Simply add the tag helper asp-append-version="true" to your script (js) or link (css) tag:

    
    

    Dave Paquette has a good example and explanation of cache busting here (bottom of page) Cache Busting

提交回复
热议问题