所谓 Cookie-free Domains, 翻译成中文叫"饼干免费域名"
但是翻译英文的时候有一种高深的语法叫倒装, 一般同学难以理解就不用转牛角尖了
说白了就是反过来翻译, 那么正确的翻译就是 免费饼干域名!
聪明的同学一看就明白了
有点呆的同学继续听我讲
免费饼干域名 说白了就是这个域名不会产生cookie
为什么不能让域名产生 cookie 呢?
当浏览器向服务器请求一张静态的图片前,会先发送同域名下的 cookie,服务器对于这些 cookie 不会做任何处理。因此它们只是在毫无意义的消耗带宽。所以你应该确保对于静态内容的请求是无coockie的请求。
域名加WWW的好处是什么?
如果我给 http://ooxx.me 设置了cookie,那么会感染所有子域名, 请求 http://plz.ooxx.me/logo.gif 时便会带上讨厌的cookie
但如果我给 http://www.ooxx.me 设置了cookie, 并不会感染其他子域名或主域名
域名不加WWW的好处
也许女孩子们不喜欢,但没错, 不加 WWW 的唯一好处就是 短
毫无疑问, 咱的域名都是被污染过的, 无法通过开一个二级域名存放图片CSS JS等静态资源
但咱有钱,可以买个域名专门放图片
Yahoo!使用的是 ymig.com,YouTube使用的是ytimg.com,
Amazon使用的是images-anazon.com, Miao.in使用的是 mediatempl.com(卖掉了)
插播广告: 世界上最大域名贩子 Godaddy.com , 只需要花$0.89 就可以买一个 .info 域名, 做 Cookie-free Domians 不是很二的选择
PS:续费很贵,用完就丢掉...
Use Cookie-free Domains for Components
When the browser makes a request for a static image and sends cookies together with the request, the server doesn't have any use for those cookies. So they only create network traffic for no good reason. You should make sure static components are requested with cookie-free requests. Create a subdomain and host all your static components there.
If your domain is www.example.org, you can host your static components on static.example.org. However, if you've already set cookies on the top-level domain example.org as opposed to www.example.org, then all the requests to static.example.org will include those cookies. In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free. Yahoo! uses yimg.com, YouTube uses ytimg.com, Amazon uses images-amazon.com and so on.
Another benefit of hosting static components on a cookie-free domain is that some proxies might refuse to cache the components that are requested with cookies. On a related note, if you wonder if you should use example.org or www.example.org for your home page, consider the cookie impact. Omitting www leaves you no choice but to write cookies to *.example.org, so for performance reasons it's best to use the www subdomain and write the cookies to that subdomain.
分享到:
相关推荐
CTFsession伪造脚本,有解密和加密的,一定要有私钥才能进行。
使用python脚本更改或生成cookie
jquery-cookie-master Cookie 设置依赖jar包
Laravel开发-laravel-cookie-consent Laravel 5的甜饼同意书(Silktide)可轻松下载
jquery-cookie-master-v1.4.1官方版(2015.09.13--源代码+示例) cookie设置,验证通过
名称:Cookie-Editor ---------------------------------------- 版本:1.12.2 作者:https://cookie-editor.cgagnier.c 分类:其他 ---------------------------------------- 概述:简单而强大的Cookie编辑器,可...
前端项目-cookie-banner,基于javascript的cookie信息横幅,用于遵守欧盟cookie法律。
火狐cookie管理插件,可对cookie进行新增、删除、修改
laravel-cookie-consent, 让你的Laravel 应用程序符合疯狂的欧盟cookie规则 让你的Laravel 应用符合疯狂的欧盟cookie法则赞助商 如果你希望快速向 Laravel 项目添加安全令牌认证,可以查看 auth0 SDK的Laravel 和 ...
前端开源库-universal-cookie-koa通用cookie koa,hook cookie get/set on koa for server rendering
您可以使用cookie-universal在浏览器,节点,连接和表达应用程序中设置,获取和删除cookie。 cookie-universal使用流行的解析cookie。 您可以使用cookie-universal-nuxt在客户端和服务器端nuxt应用程序中设置,获取...
Cookie-Clicker-site-free
npm package of express, koa, body-parse, cookie-parse, cookie-session
火狐cookie管理插件,可对cookie进行新增、删除、修改,直接拖入浏览器即可安装
zepto-Cookie-master
EditThisCookie is a cookie manager. You can add, delete, edit, search, protect, and block cookies! Inspired by the lack of good cookie managers in Google Chrome, I developed this small, simple, and ...
cookie-manager-1.2.crx
django-cookie-同意通过身份验证的用户 插件,可将用户的cookie首选项保存在数据库中。 安装 您需要先安装django-cookie-consent : pip install -e git://github....