【发布时间】:2018-08-08 09:38:20
【问题描述】:
我有一个 Windows 上的 asp.net 网站,其中包含永远不会更改的文件的顶级服务器端缓存。不出所料,文件已更改。如何重置服务器端缓存?我已经在代码中看到了很多如何做到这一点,但我不想添加一个新页面来清除缓存,除非我也有。 IISreset 或 box 重置将清除缓存,但这是相当激烈的。应用程序池会回收吗?应用程序池设置为在空闲超时后终止,这可能会在一夜之间发生,这会清除缓存吗?
代码是:
using WebApi.OutputCache.V2;
namespace Foo.Web.API.Controllers
{
public class BarController : ApiController
{
[HttpGet]
[CacheOutput ServerTimeSpan = 31536000)]
public HttpResponseMessage Get(string organisationId, string file)
{
【问题讨论】: