缓存是客户端还是服务器端? [英] Cache is client side or server side?

查看:276
本文介绍了缓存是客户端还是服务器端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对缓存感到困惑。是客户端还是服务器端?如何在客户端存储缓存,并在服务器端存储缓存?而如果缓存存储在服务器端,那为什么人们要在浏览器中清除缓存呢?

I am confused in "cache". Is it client side or server side? How to store cache client side and how to store cache on server side? And If cache store in server side then why people do clear cache in browser?

推荐答案


是客户端还是服务器端?

Is it client side or server side?

可以是一个或两个。

服务器端缓存通常用于避免重复进行昂贵的数据库操作,以将相同的内容提供给许多不同的客户端。

Server side caches are generally used to avoid making expensive database operations repeatedly to serve up the same content to lots of different clients.

客户端缓存用于避免通过网络重复传输相同的数据。

Client side caches are used to avoid transferring the same data over the network repeatedly.


如何存储缓存客户端

How to store cache client side

发送缓存控制HTTP响应标头,例如:

Cache-Control: max-age=86400, must-revalidate, public




如何在服务器端存储缓存?

how to store cache on server side?

通常使用专业的前端缓存服务器,例如 Memcached

Generally this would be done using specialist frontend caching servers such as Memcached.

您已将此标签标记为ASP.NET因此值得指出的是,它具有内置缓存

You tagged this ASP.NET so it is worth pointing out that it has built-in caching.

这篇关于缓存是客户端还是服务器端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆