Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp net javascript Cache clear

I have a website that i did some time ago now they request some new features and i did some changes in some javascript files, but when i publish the clients that use the IE have problems with cache so in they browser they have old version of javascript. How can i clear the client cache so when they visit website they use latest javascript files that i modify.

like image 627
Florim Maxhuni Avatar asked Oct 14 '22 08:10

Florim Maxhuni


1 Answers

When you refer your javascript file append a version number also to the end of the file as a query string. Something like

<script src="yourjsfile?version=1.0" type="text/javascript"></script>

This will refer to a new url which won't be present in the cache and the browser will download the latest file.

like image 178
rahul Avatar answered Oct 26 '22 22:10

rahul