简体   繁体   English

在Expire C#MVC上刷新OutputCache

[英]Refresh OutputCache on Expire C# MVC

I am creating a web application, which queries the database and gets data from it. 我正在创建一个Web应用程序,该应用程序查询数据库并从中获取数据。 I need to use the OutputCaching to cache the data retrieved from database. 我需要使用OutputCaching缓存从数据库检索的数据。 My question is, is it possible to automatically cache from the database again as soon as it's expired. 我的问题是,一旦过期,是否可以从数据库中再次自动进行缓存。

Well, if you think about your question, you're really asking "Is there an active process that can either be notified or be able to poll OutputCache and act on certain events (expiration)". 好吧,如果您考虑到您的问题,您实际上是在“是否有一个活动进程可以被通知或可以轮询OutputCache并根据某些事件(过期)采取行动”。 Or variations of this, where an external component is able to mimic enough of OutputCache functionality in addition to extending it with "content expiration" event of some sort. 或此方法的变体,其中外部组件除了可以通过某种“内容过期”事件进行扩展之外,还可以模仿足够的OutputCache功能。 The answer to all such question flavors is "no such animal exist out of the box, but you can certainly craft one yourself if you requirements warrant such complexity". 对所有这些问题口味的回答是“没有这样的动物,但如果您需要保证如此复杂,您当然可以自己制作”。

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

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