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

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

问题描述

cookie 的大小是否有任何限制?另外,这个浏览器是否依赖?

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

推荐答案

官方"的最大大小为 4KB,但我更愿意将其很好保持在:不超过几百字节,顶部.

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

原因是每次请求都会将cookies从客户端传输到服务器——即使在请求图像、css和js文件时(如果它们驻留在同一主机上一般应该避免的事情,但对于小型网站来说可能不值得费心).这意味着您将要求客户端为每个请求传输 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天全站免登陆