S
S
Sergey Khlopov2018-05-20 16:21:22
Google
Sergey Khlopov, 2018-05-20 16:21:22

Why does the "Use browser cache" option remain in Google PageSpeed?

Hello, please tell me, I check the site in the Google PageSpeed ​​service, specify caching in the .htaccess file
. The content is as follows:

# Cache-Control
<ifModule mod_headers.c>
# 30 дней
<filesMatch "\.(ico|pdf|flv|swf|webp|woff)$">
Header set Cache-Control "max-age=86400, public"
</filesMatch>
<filesMatch "\.(jpg|jpeg|png|gif)$">
Header set Cache-Control "max-age=86400, public"
</filesMatch>
# 30 дней
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=86400, public"
</filesMatch>
<FilesMatch "\.(css)$">
  Header set Cache-Control "max-age=86400, public"
</FilesMatch>
# 2 дня
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=86400, public, must-revalidate"
</filesMatch>
# 1 день
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=86400, private, must-revalidate"
</filesMatch>
</ifModule>

5b01761b1ef82963564664.jpeg
But when I perform a check, I write the sentence "Use the browser cache"
But the cache time is in brackets everywhere, and according to the idea, this sentence should then disappear, or maybe the Yandex metric is connected and it also needs to be cached, but next to it is also in brackets the cache time is indicated, and I’m just for the test, I tried to remove it, and check it again, anyway, this offer remained. Please tell me what is wrong here. It's just that on all points the time is in brackets. Thank you in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Merzley, 2018-05-20
@Merzley

Google still thinks the cache time is too short. I did not find information about how much time and for what types of files Google considers the norm, so try to set not 24 hours, but, say, a year. In theory it should help.
Yes, 86400 sec == 24 hours

O
Otrivin, 2018-05-22
@Otrivin

On some hostings, htaccess does not help - you need to manually set compression and caching for the site in the ISP panel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question