简体   繁体   English

如何清除IIS中的服务器缓存

[英]How to clear the server cache in iis

I've got a asp.net web site on windows with rather over the top server side caching of files that never change. 我在Windows上有一个asp.net网站,而在服务器的顶部缓存着永不更改的文件。 Unsurprisingly the files have changed. 毫不奇怪,文件已更改。 How do I reset the server side cache? 如何重置服务器端缓存? I've see lots of how to do it in code but I don't want to add a new page that will clear the cache unless I have too. 我已经在代码中看到了很多如何做的方法,但是除非有必要,否则我不想添加新的页面来清除缓存。 An IISreset or a box reset will clear the cache but that's rather drastic. IISreset或Box重置将清除缓存,但这相当麻烦。 Will an application pool recycle? 应用程序池会回收吗? The app pools are set to terminate after idle time out, that'll probably happen overnight will that clear the cache? 应用程序池设置为在空闲超时后终止,这很可能会在一夜之间发生,这将清除缓存吗?

code is: 代码是:

using WebApi.OutputCache.V2;

namespace Foo.Web.API.Controllers
{
    public class BarController :  ApiController
    {
        [HttpGet]
        [CacheOutput ServerTimeSpan = 31536000)]
        public HttpResponseMessage Get(string organisationId, string file)
        {

Both clear the cache. 两者都清除缓存。 Recycling an App Pool is just less drastic, as it continues to process already received requests and cycles after that. 回收应用程序池的麻烦程度不再那么大,因为它继续处理已收到的请求并在此之后循环。 This can be done under load - never had issues with it. 这可以在负载下完成-从来没有问题。

I had to delete the files here. 我不得不在这里删除文件。 This is all that worked for me. 这就是为我工作的全部。

C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ ASP.NET临时文件C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ ASP.NET临时文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM