【发布时间】:2016-05-11 17:35:02
【问题描述】:
这不是我见过的问题,通常是“EPiServer 没有清除输出缓存”。我试图达到相反的效果。每次发布页面时,都会删除整个缓存,并且客户端每天发布几次,这令人沮丧。
我正在使用 [ContentOutputCache] 属性并尝试在 EPiServer 中实现带有随附计划任务的 httpCacheVaryByCustom 规则,以在我们决定将更新捆绑在一起并在预定时间失效时使缓存失效。
我已经测试了这条规则,它可以使用:
public override string GetVaryByCustomString(HttpContext context, string custom)
我的印象是,通过使用这种类型的缓存规则,每当发布/上传媒体时,EPiServer 都会停止转储我的缓存。
但有没有办法阻止这种情况发生?
我通过使用标准 [OutputCache] 和相同的自定义字符串规则取得了成功,唯一的问题是编辑者总是会看到他们正在编辑的页面的缓存版本。
我在 EPiServer 的 web.config 中的应用程序设置是:
<applicationSettings globalErrorHandling="Off" operationCompatibility="DynamicProperties" uiSafeHtmlTags="b,i,u,br,em,strong,p,a,img,ol,ul,li" disableVersionDeletion="false"
httpCacheability="Public" uiEditorCssPaths="~/assets/css/styles.css, ~/assets/css/editor.css" urlRebaseKind="ToRootRelative"
pageUseBrowserLanguagePreferences="false" uiShowGlobalizationUserInterface="false" subscriptionHandler="EPiServer.Personalization.SubscriptionMail,EPiServer"
uiMaxVersions="20" pageValidateTemplate="false" utilUrl="~/util/"
uiUrl="~/EPiServer/CMS/" httpCacheExpiration="01:00:00" httpCacheVaryByCustom="invalidateSiteCache" />
【问题讨论】:
-
您的 web.config 中有哪些内容用于 ContentOutputCache?
-
嗨 Ollie,我已经从上面的 web.config 添加了应用程序设置。
-
我明白你的意思我的 web.config 中没有 outputCache 将添加这个
标签: caching outputcache episerver