在进行网站速度测试时,我经常会看到以下注释:
从无Cookie域提供静态内容
我想确保从static
域提供的数据 - 扩展名为JS,SVG,PNG,JPG和CSS的文件 - 不会设置Cookie。
以下是我.htaccess
的一部分:
<FilesMatch "\.(js|svg|png|jpg|css)$">
<IfModule header_module>
Header unset Cookie
</IfModule>
</FilesMatch>
我为static.example.com
设置了一个CNAME条目,其记录为www.example.com
。
如何确保从子域提供的所有文件或具有这些扩展名的任何文件都不设置Cookie?