如何使用无Cookie域设置IIS以提高性能? [英] How do I setup IIS with a cookieless domain to improve performance?

查看:204
本文介绍了如何使用无Cookie域设置IIS以提高性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在谷歌的文档中阅读他们的新 pagespeed 插件,他们建议使用无Cookie域名来提高效果:

I was reading in google's documentation their new pagespeed plugin, that they recommend using cookieless domains to improve performance:


静态内容,如图像,JS和CSS文件,不需要附带cookie,因为没有用户交互有了这些资源。您可以通过从不提供cookie的域提供静态资源来减少请求延迟。

Static content, such as images, JS and CSS files, don't need to be accompanied by cookies, as there is no user interaction with these resources. You can decrease request latency by serving static resources from a domain that doesn't serve cookies.

有人知道如何在IIS中执行此操作吗?

Does anybody know how to do this in IIS?

推荐答案

Google文章的建议是,您提供来自其他域的所有静态内容,其中Cookie最初不是由该服务域设置的。

What the Google article is suggesting is that you serve all your static content from another domain where cookies are not initially set by that serving domain.

Cookie以两种方式设置 - 通过会话cookie(例如通过ASP或ASP.NET请求)或由您的应用程序明确设置。

Cookies are set in two ways - by session cookies (e.g. by ASP or ASP.NET requests) or explicitly by your application.

这些将被发布回服务器对设置cookie的域的每个后续请求(无论请求是针对静态还是动态内容),从而增加请求有效负载。

These will be posted back TO the server on each subsequent request for the domain that set the cookie (regardless of whether the request is for static or dynamic content) thus increasing the request payload.

你正在做什么通过拥有第二个域来提供静态内容(HTML,CSS,图像等)正在进行cookie免费请求,因为该域的首位不会设置初始cookie。

What you're doing by having a second domain to serve static content (HTML, CSS, Images etc) is making cookie free requests because no initial cookie would be set in the first place for that domain.

在IIS中,它是您的应用程序,ISAPI筛选器或将添加cookie的ISAPI扩展。如果您的IIS服务器没有拦截静态内容请求(因为这通常由内核模式http.sys驱动程序处理),则不会将任何cookie添加到响应中。它只是在请求管道中进一步发挥作用。

In IIS it's your application, ISAPI Filter or ISAPI extension that will add a cookie. If your IIS server is not intercepting requests for static content (because this is usually handled by the kernel mode http.sys driver) then no cookies will be added to the response. It's only further up the request pipeline that cookies come into play.

所以基本上没有办法在IIS中明确配置无cookie域。

So basically there isn't a way to explicitly configure cookie-less domains in IIS.

这篇关于如何使用无Cookie域设置IIS以提高性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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