在网站中,设置一个Cookie比设置许多单个Cookie好? [英] in a website, setting one cookie is better than setting many single cookies?
问题描述
假设您必须设置12个Cookie,最好将所有值存储在单个大Cookie中,或将每个值存储在自己的Cookie上吗?
我想知道是否能提高网站速度。
Suppose that you have to set 12 cookies, would it be better to store all of their values in a single "big" cookie or store each value on its own cookie? I want to know if that improves website speed.
谢谢。
推荐答案
我认为cookie的最大大小约为4k。如果您需要存储更多的数据,那么您最好使用几个Cookie。
I think the maximium size of a cookie is about 4k. If you need to store more data than that, then you're better off using several cookies.
我不认为使用多个Cookie会有很大的性能问题。在我看来,将每条数据存储在自己的cookie中可能更有效,而不是在每次需要时通过bogger cookie为每个crum数据解析。
i don't think there will be a big performance issue using multiple cookies. in my opinion, it may be more efficient to store each piece of data in its own cookie rather than parsing through a bogger cookie for each "crum" of data each time you need it.
希望这有助于!
这篇关于在网站中,设置一个Cookie比设置许多单个Cookie好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!