.htaccess缓存图片代码,好使不好使,先记下来

代码一:

       
        <filesmatch "\.(ico|jpg|gif|png|css|gz)$">
        ExpiresActive on
        Header set Cache-Control "max-age=2592000"

代码二:

<IfModule mod_deflate.c>

# Insert filters

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

AddOutputFilterByType DEFLATE application/x-httpd-php

AddOutputFilterByType DEFLATE application/x-httpd-fastphp

AddOutputFilterByType DEFLATE image/svg+xml

# Drop problematic browsers

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4\.0[678] no-gzip

BrowserMatch \bMSI[E]!no-gzip !gzip-only-text/html

# Make sure proxies don‘t deliver the wrong content

Header append Vary User-Agent env=!dont-vary

</IfModule>

未经允许不得转载:啊福主机 » .htaccess缓存图片代码,好使不好使,先记下来

赞 (0)

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址