English 中文(简体)
IIS ASP.NET cs/js 文件在强制更新页面之前没有更新
原标题:IIS ASP.NET css/js files not updating until forced page refresh

当我们在IIS 7中发布时,我们为服务器上的释放目录安装了新的代码,然后将IIS网站重新保留到新的代码目录中。例如:

C:公司电子租赁代码5-17-12改为C:公司电子租赁代码5-26-12。

这项战略让我们回到最坏情况下的先前版本。 然而,我面临的问题是,当一个在网站上的用户进入网页时,有时他们可能需要明确更新网页,以获得新的更新代码。

这是否是一个缓存问题?是否有办法可以过期,这样网站的用户就不会装上先前发布的旧代码?

这对 Javarint 文件 和 css 文件来说是一个特殊的问题 。

最佳回答

我得到了这个工作:

我在每个 cs 和 js 文件名的末尾添加了 < code>? vlt;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

问题回答

The problem with that solution is that your users will always be downloading new css s and js s because <%=DateTime.Now.Ticks%> will be different in every refresh. A better solution would be to concatenate the version of the application or even the last modified date of the file itself.





相关问题
Prevent IE caching

I am developing a Java EE web application using Struts. The problem is with Internet Explorer caching. If an user logs out he can access some pages because they are cached and no request is made. If I ...

Explanation for expires header

I have a joomla application working on Apache.To improve site performace we have written a .htaccess file to root of the application with setting a far future expires header to all the static content. ...

How does SO s form remember previous input values?

I ve noticed that the Title or Body part is remembered if I come back to the Ask Question page by pressing Back button of my browser. This feature is available in all browsers I tested, but doesn t ...

Why do firefox/chrome show a different page than IE8?

When I look at this published Google Docs document, I see the latest version with Firefox and Chrome, but an older version with IE8. Also, screen-scraping it via PHP/Curl gives me an older version. ...

Stop browser from filling textboxes with details

I ve run into a really annoying problem, and I m hoping it s just a setting I ve missed. I ve got an ASP.NET application which allows users to enter their username/password in various places (e.g. ...

Google App Engine: localhost browser caching?

I m developing with GAE on my own machine. It was pretty fast, until I added CSS and images, at which point the page loads much more slowly. I suspect that the browser isn t caching anything, perhaps ...

ASP.NET MVC 2 RC Caching Problem

Since upgrading from mvc 2 beta 2 to rc I m having trouble with an ajax submission in Internet Explorer. Upon carrying out a jquery form post, the function returns a url to a controller action. This ...

热门标签