D
D
DMax9212018-03-08 03:59:52
WordPress
DMax921, 2018-03-08 03:59:52

How to cache images on the side of the WP browser?

Hello dear friends!
Please tell me how to cache images on the browser side, which are pulled by links from another site, in fact, cache links, or is it not possible?
The fact is that a few days ago, PageSpeed ​​Insights showed 95% for PC, and now 45%, and this is scary, especially if they say that PageSpeed ​​Insights affects the rendering.
I would like to fix it, and one of the points is Kee browser.
I kind of added the necessary directives to .htaccess, and even this one

<ifModule mod_headers.c>
# Все html и htm файлы будут храниться в кэше браузера одну минуту
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=60"
</FilesMatch>
# Все css, javascript и текстовые файлы будут храниться в кэше браузера одну неделю
<FilesMatch "\.(js|css|txt)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
# Все флэш файлы и изображения будут храниться в кэше браузера один месяц
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
# Отключаем кеширование php и других служебных файлов
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>

But this bastard still swears at the browser cache.
Please let me know, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-03-08
@azerphoenix

And you can screen on the fact that he swears. This means which pages, pictures, etc.
I know from my own experience that although it sounds crazy, you need to download and add all the pictures locally.
If these are avatars from Gravatar, then plugins:
https://ru.wordpress.org/plugins/fv-gravatar-cache/
https://ru.wordpress.org/plugins/harrys-gravatar-cache/
(cache gravatars)
If these are external images that are stored in the_content, then
https://wordpress.org/plugins/lh-cache-remote-images/
(caches images locally)
Google even complains about CDN scripts and styles... so they also need to be connected locally. Again, this is bullshit...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question