How can I be sure that my user is using/seeing the latest version of my static content (js scripts, gifs, svgs, etc...) without telling them to clear their cache?
Asked
Active
Viewed 51 times
0
-
Google "cache busting in asp.net mvc". – NightOwl888 Jun 13 '17 at 16:03
1 Answers
1
You have two broad options.
- Disable caching altogether. That is a reasonable idea for dynamic content but generally poor for static content. So we will ignore this for now.
- Generate different URLs / querystring for when your static content changes.
There are many possible approaches for option 2, for example:
- https://zoompf.com/blog/2015/01/automatically-optimize-css-javascript-asp-net
- How to version javascript files in a Bundle?
- What is the best way to version javascript files in a huge asp.net legacy project
- Autoversioning CSS/JS in ASP.NET MVC?
Additionally, https://github.com/mwrock/RequestReduce is an option I have used in the past that you may want to have a go with.

mjwills
- 23,389
- 6
- 40
- 63