D
D
Dmitry2016-01-31 00:22:29
PHP
Dmitry, 2016-01-31 00:22:29

How to cache a site?

Google PageSpeed ​​Insights recommends caching to me
but I only have 6 pages on my site and there is no engine.
What and where should be registered as a setting to be caching for a period of a month?
placed in the root of the site .htaccess
with the following content

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

    ExpiresByType image/gif "access plus 1 months"
    ExpiresByType image/jpeg "access plus 1 months"
</IfModule>

but nothing has changed in PageSpeed, we still offer caching

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bears, 2016-01-31
@bears

To make Google speed happy)

<ifModule mod_headers.c>
    <FilesMatch "\.(js|css|ico|gif|jpg|jpeg|png)$">
        Header set Cache-Control "max-age=604800"
    </FilesMatch>
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question