Specifing Expiration Date For Static File's Caches

前端 未结 5 969
春和景丽
春和景丽 2021-01-31 00:33

When i test my website for SpeedTest i\'m seeing a lot of expiration not specified error.You can see at this page .

I added this code to my .htaccess f

5条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 00:34

    You can use mod_headers to do the trick:

    
      Header set Cache-Control "max-age=290304000, public"
    
    

    Or you can use mod_expires:

    ExpiresByType text/html "access plus 1 month 15 days 2 hours"
    ExpiresByType image/gif "modification plus 5 hours 3 minutes"
    

提交回复
热议问题