Web 场环境中 ASP.NET 网站的数据缓存

发布于 2024-12-04 09:43:33 字数 420 浏览 0 评论 0原文

我做了一些搜索,但没有找到具体的答案。无论如何,我想知道大多数中型基于 ASP.NET 的网站如何缓存数据,以便它们在网络场环境中运行时不必总是在不同页面上数据库查找相同的数据。我知道您可以使用 sql server 缓存,但对我来说,这违背了缓存的全部目的。如果我想使用专用服务器来共享缓存(甚至可能的会话数据),大多数站点会使用什么?我已经进行了搜索,并在实现方面得到了很多“猜测”,但考虑到有如此之多的 ASP.NET 网站,真的很难相信没有某种标准方法可以做到这一点。

我知道 AppFabric 似乎可以解决这个问题,但只能在 Windows Server 2008+ 上运行,我们目前使用的是 2003。另外,我已经检查过 NCache,但它似乎有点贵。

有人实施了适合他们的解决方案吗?当 1000 多个用户同时访问您的网站时,数据库查找可能会非常慢。

提前致谢!

I've done some searching and haven't found a specific answer. Anyhow, I was wondering how most medium sized ASP.NET based websites cache data so that they don't always have to database look ups for the same data on different pages when running on a web farm environment. I'm aware that you can use a sql server cache, but to me, that defeats the whole purpose of the cache. If I want to use a dedicated server to share cache (and even possible session data), what do most sites use for this? I've done searching and get a lot of 'guesses' when it comes to implementations, but it's really hard to believe that there isn't some standard way of doing this given that there are so many ASP.NET websites out there.

I am aware of AppFabric that seems like it might do the trick, but only runs on Windows server 2008+ and we're currently using 2003. Also, I've checked out NCache but it seems to be a little pricey.

Has anyone implemented a solution that worked for them? Database lookups can be quite painfully slow when 1000+ users are hitting your site simultaneously.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆离笙 2024-12-11 09:43:33

可能想看看 HttpContext.CacheHttpRuntime.Cache

您可以获得然后从数据库中获取信息创建数据集(或字典,或任何你想要的),然后将它们存储在缓存中以供站点范围内引用。

您甚至可以指定缓存保留的时间。当它过期时,对该数据的下一个请求将转到数据库并重新创建缓存。

Might want to take a look at HttpContext.Cache and HttpRuntime.Cache

You can get your information from the database then create datasets (or dictionaries, or whatever you want) and then store those in cache to be referenced site wide.

You can even specify how long you want the cache to persist. And when it expires the next request for that data will go to the database and recreate your cache.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文