How can I clear JavaScript and CSS cache in ASP MVC without Clear browser > history?
Asked
Active
Viewed 592 times
1
-
From javascript you can use location.reload(true); which forces a load from the server, but it refreshes the page, or you can take a look at this SO question: http://stackoverflow.com/questions/8306839/how-to-clear-browser-cache-programatically which is asp.net related. – BFG Mar 01 '17 at 07:14
1 Answers
0
There is no direct and easy of doing so. Closest I can think of would be is to use:
window.location.reload(true)
It will ignore the current cached items and will try fetching the new ones.
The better approach I can think of is about using a version number to the path or filename, like PATH?v=VersionNumber

Bijoy Anupam
- 567
- 1
- 5
- 12