A
A
Alexander2016-04-18 13:35:06
Apache HTTP Server
Alexander, 2016-04-18 13:35:06

How to optimize cache for google pagespeed?

I optimize the site for google pagespeed.
Added the following caching code to htaccess

<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$">
  Header set Cache-Control "max-age=2592000"
</FilesMatch>

The points have slightly increased, but Google still displays a list of non-cached files and a recommendation to cache the site in red. How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Zakharov, 2016-04-18
@werwolf87

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 week"

    ExpiresByType image/gif "access plus 1 day"
    ExpiresByType image/jpeg "access plus 1 day"
    ExpiresByType image/jpg "access plus 1 day"
    ExpiresByType image/png "access plus 1 day"
</IfModule>

Set the time you need for each type of resource.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question