Home  >  Q&A  >  body text

seo - Apache How to avoid setting cookies for static files

Baidu Webmaster Tools Optimization Tips:

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

server

Win64 Apache2.4.x PHP5.5.x

htaccess

max-age has been enabled in htaccess

<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>

How can we achieve this optimization of Baidu Webmaster Tool Tips?

天蓬老师天蓬老师2713 days ago833

reply all(2)I'll reply

  • 某草草

    某草草2017-05-16 17:05:20

    Place static files in different domains to avoid~

    reply
    0
  • 为情所困

    为情所困2017-05-16 17:05:20

    /q/1010000000252213/a-1020000000420919

    Static files should be stored on subdomain names. If not adding www pollutes the main domain name, it must be divided into independent domain names for storage.

    reply
    0
  • Cancelreply