Apache 如何 对于静态文件需要避免设置cookie

百度站长工具优化提示:

cookie越小越好,而且对于静态文件需要避免设置cookie

图片描述

服务器

Win64 Apache2.4.x PHP5.5.x

htaccess

已经在htaccess中开启了 max-age

<IfModule mod_headers.c>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
<FilesMatch "\.(html|htm|php|shtml)$">
Header set Cache-Control "max-age=86400"
</FilesMatch>
</IfModule>

如何才可以实现百度站长工具提示的这一句优化?

阅读 6.4k
2 个回答

将静态文件放在不同域下 即可避免~