KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Some browsers cache js and css files, failing to refresh them unless you force them to. What's the easiest way. I just implemented this solution that seems to work. Declare a version variable on your page public string version { get; set; } Get the version number from web.config key version = ConfigurationManager.AppSettings["versionNumber"]; In your aspx page make the calls to javascript and stylesheets like so <script src="scripts/myjavascript.js?v=<%=version %>" type="text/javascript"></script> <link href="styles/mystyle.css?v=<%=version %>" rel="stylesheet" type="text/css" /> So if you set the version = 1.1 from 1.0 in your web.config your browser will download the latest files which will hopefully save you and your users some frustration. Is there another solution that works better, or will this cause any unforeseen issues for a website?
Tags (comma-separated)
Save Edits
Cancel