什么是cookie文件的最大尺寸是多少? [英] What is the maximum size of a cookie file?

查看:105
本文介绍了什么是cookie文件的最大尺寸是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有对cookie的大小是否有限制?此外,这是依赖于浏览器?

Are there any limitations on the size of the cookie? Also, is this browser dependent?

推荐答案

官方的最大大小为4KB,但我会preFER保持它的以及下的是:不超过几百个字节,顶部。

The "official" maximum size is 4KB, but I would prefer to keep it well under that: no more than a few hundred bytes, tops.

原因是,cookie是从客户端发送到服务器的每一个请求的 - 即使请求图像,CSS和JS文件时(如果它们驻留在同一台主机的something~~V应避免在一般,但对于小网站可能不值得麻烦)。这意味着,你会被要求在客户端传输4KB的的每一个请求 - 记忆也是大多数消费者宽带已经上传速度比下载速度慢得多

The reason is that cookies are transmitted from the client to the server with every single request - even when requesting images, css and js files (if they reside on the same host something you should avoid in general, but for small sites may not be worth the bother). That means that you'll be requiring the client to transmit 4KB for every request - remembering also that most consumer broadband has much slower upload speed than download speed.

这篇关于什么是cookie文件的最大尺寸是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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