I've a ASP.Net MVC + angular web application. And about 500 + users are using the application.
The problem is whenever we do a new publish/ release we have to say the users to clear their browser cache. This is annoying for the users.
How other websites such as facebook etc.. manage the browser cache when they update their application/site since we don't clear our browser cache too often.
Is there any way to automatically clear borwser cache when there is a new release.
With ASP.Net Core MVC you can use the asp-append-version TagHelper for your script files. It calculates a hash of the file and appends it to the filename:
<link rel="stylesheet" type="text/css" href="myfile.css" asp-append-version="true" />
<script src="myfile.js" asp-append-version="true"></script>
so the files would become something like this:
<link rel=stylesheet href="myfile.css?v=qWYa_XOt9FCnEt2z8CjC7apiyjA5l9UA9UCqT028LI">
<script src="myfile.js?v=eN9kwxdWtX5aP8H3TFVOQrwu08Qndyktg5kvpSLa1A">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With