How to use the browser cache of users to speed up the site (headers Last-Modified, ETag, Expires, Cache-Control)

The next step to speed up the site and implement the related recommendations of the PageSpeed ​​Insights service is an event to configure caching in users' browsers

The next step to speed up the site and implement the related recommendations of the PageSpeed ​​Insights service is an event to configure caching in users' browsers.

Let us examine in detail this part of the optimization of a web resource, which can be implemented by inserting the appropriate directives into the server’s .htaccess configuration file that is running Apache software.

Setting up caching in the users browser in order to increase the speed of the site

Remember, at the beginning of the post I mentioned that the proposed option is not 100% universal and not suitable for everyone? Unfortunately, this is so. The fact is that this method is suitable only for servers managed by Apache software (of which, the overwhelming majority, however).

Moreover, the movements described below will only give results if the Apache works in its pure form. If you use a bunch of Apache + nginx, then you will have to configure the latter, and in this case, the owners of the sites on shared virtual hosting cannot do without help. So you have to contact the hoster (however, also an option).

So, we will configure the output of pages from the cache by specifying special directives that are written in the .htaccess file , which is nothing more than a means of remote administration of the server where your project is located.

All editing actions on the server should be controlled by you, so be sure to make copies of the files to be changed so that, if possible, to return the original state of the site.

There is a .htaccess usually in the root directory (public_html folder or htdocs) of your site. First, check its availability by connecting to a remote server where your project is hosted, via an FTP connection ( here I have the Filezilla manager disassembled by the bones). If you are not observing the .htaccess file, then try selecting “Server” - “Forcibly display hidden files” from the top FileZilla menu:

Read details about the implementation of caching in browsers.

Добро пожаловать , Гость !

Мы настоятельно рекомендуем Вам зарегистрироваться, если вы ещё этого не сделали. регистрация откроет Вам новые функции.

Войти или Зарегистрироваться

www.silvio-berluskoni.ru © Все права защищены © 2016.