简体   繁体   English

关闭数据缓存asp.net

[英]Turning off data caching asp.net

I make generous use of data caching in my asp.net application. 我在asp.net应用程序中大量使用了数据缓存。 However, my pathetic little laptop does not have the RAM to handle this making development testing hard... 但是,我可怜的小笔记本电脑没有RAM来处理此问题,因此很难进行开发测试。

Does any one know how I can temporarily turn off data caching without going through my code and adding conditionals? 有谁知道如何在不检查代码和添加条件的情况下临时关闭数据缓存?

Thanks! 谢谢!

PS I just want to clarify that I am not talking about client side caching or output caching. PS:我只是想澄清一下,我不是在谈论客户端缓存或输出缓存。

I would abstract the caching to an interface which you can implement in 2 different ways using dependency injection or using a factory approach. 我将缓存抽象到一个接口,您可以使用依赖注入或工厂方法以两种不同的方式实现该接口。 This way you can work with a generic cache and leave your code as is (not worrying about whether or not caching should be used). 这样,您可以使用通用缓存并将代码保持不变(不必担心是否应使用缓存)。

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

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