0

I have a Concrete5 site which already has a bunch of contents and I want to point the images to my cookieless domain without replacing the urls.

I created an htaccess that will redirect all images from my main site to the cookieless domain

http://www.example.com/images/header.jpg

to


http://static.example.com/images/header.jpg

It's actually working but YSlow doesn't seem to honor this. It's still giving me a low score on that part.

4

1 回答 1

1

由于您没有更改图像链接,浏览器仍会向原始 URL 发出请求并发送 cookie。这可能就是为什么 YSlow 仍然给你一个低分的原因。

要正确更改它,您需要:

  1. 将所有链接更改为新的无 cookie 域 (static.example.com)
  2. 更改仅针对 www.example.com 发布的 cookie(根据上面的 Croises 评论)
  3. 删除图像的重定向

要完成很多工作,并且根据您的网站流量,这可能不值得。与所有 YSlow 规则(以及来自其他工具的规则)一样,了解这些建议很重要。并非所有这些都值得所有网站的努力。

参考:无 Cookie 域最佳实践

于 2014-11-06T20:40:13.670 回答