Answer the question
In order to leave comments, you need to log in
How to cache for Google Page Speed?
Googled, they write to add entries like this to htaccess:
<IfModule mod_expires.c>
# 1 YEAR
<FilesMatch "\.(ico|pdf|flv)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>
# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf|css)$">
Header set Cache-Control "max-age=694800, public"
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 8 days"
</IfModule>
header('Last-Modified: Mon, 18 Oct 2017 14:15:00 GMT');
Answer the question
In order to leave comments, you need to log in
Something like this ... Well, you can already set up the types and terms there yourself.
<FilesMatch "\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|js|css)$">
ExpiresActive on
ExpiresDefault "access plus 35 days"
</FilesMatch>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question