0

I'm caching some objects in code behind in web page i want to implement a windows service that keep refreshing this object with latest data can i access the System.web.caching from windows service?

4

2 回答 2

1

您可以通过通用处理程序使用某种 Web 服务,并让 Windows 服务与之对话以更新网站上的项目。

但是,我个人会使用像 Couchbase (Memcache) 这样的外部缓存,并让网站和 Windows 服务都使用它。

于 2013-08-20T09:18:19.727 回答
1

您不能将 ASP.net 缓存用作 Windows 服务和网站之间的共享缓存。Windows 服务将无法访问它。

为了做你想做的事,你应该使用外部缓存。例如,在同一台机器或不同的可访问机器上设置Redis,并从 Windows 服务访问它以刷新您的数据,并从 Web 站点访问它以检索预缓存的数据。

于 2013-08-20T09:21:30.383 回答