哪些类型的信息缓存在内存中?

发布于 2024-08-18 12:56:54 字数 294 浏览 5 评论 0原文

在类似节点的网站中,很容易决定将哪些信息缓存在内存中,在该网站中,节点很少,但可以将最流行的页面保留在内存中。但是对于所有页面都有相同机会被需要的网站呢?

例如 - 维基站点或社交网络?

已添加

“添加评论”按钮出现问题... 好吧,实际上,我会问“有什么东西受伤了,医生,帮帮我”之类的问题,不是吗?)

因此,在对站点的静态部分进行逻辑缓存之后,您只能缓存尽可能多的准备结果(不在内存中) ,但在某个地方)。你能做的就是这些了,如果我错了,请纠正我。

It's easy to decide which information to cache in memory in a node-like web-site, where you have few nodes, most popular pages, you can keep in memory. But what about sites where the whole mass of pages has same chances to be required?

For example - Wiki-sites or social nets?

added

Something's wrong with "add comment" button...
Well, actually, I ask question like "something hurts, doctor, help me", isn't it?)

So, after logical caching of static part of site, you can only cache as much ready results as you can (not in memory, but somewhere). That's all you can do, сorrect me if I'm wrong.

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

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

发布评论

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

评论(3

惟欲睡 2024-08-25 12:56:54

识别 Web 内容中静态的、可能最受欢迎的、大型的部分(例如动画、图像)。这些通常是您应该首先考虑的部分。

在这里您可以找到优秀的缓存教程

Identify parts of your Web content that is static, potentially most popular, large (for instance animations, images). These are usually the parts you should consider first.

Here you can find excellent Caching Tutorial

不喜欢何必死缠烂打 2024-08-25 12:56:54

当且仅当您有一些(空间、时间)局部性时,缓存才有意义,例如最频繁的查询(时间局部性)。
如果您有一个以统一概率获取每个页面的模型,那么缓存完全是无稽之谈,是的。

Caching makes sense if and only if you have some (spatial, temporal) locality, such as the most frequent queries (temporal locality).
If you have a model where each page is fetched with uniform probability, then caching is a complete nonsense, yes.

眼眸 2024-08-25 12:56:54

需要分析的一件事是,页面中的信息是否需要始终保持最新,或者您是否可以延迟更新,将它们保存在缓存中一段时间​​。这取决于网站的类型。
有一些真正的大站点会达到一段时间内数据不一致的程度,直到所有缓存节点都更新为止。

One thing to analyze is if the information in your pages needs to be always up to date or if you could delay the updates holding them in a cache for period of time. This dependes on the kind of site.
There are some real big sites that reaches to the point of having inconsistent data for a while until all cache nodes are updated.

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