Yandex writes: Keep track of the HTTP headers. In particular, the content of the response that the server sends to the if-modified-since request is important. The Last-Modified header should give the correct date of the last document change.

Google writes: Make sure your web server supports the If-Modified-Since HTTP header. With it, Google can find out if the content of the site has changed since the last crawl. This feature helps to reduce the extra load on the server.

Logic: To speed up the indexing of new products by search engines and new pages, as well as re-indexing changes on the page, to reduce the load on the hosting, you need to correctly give the server header MODIFIED_SINCE. The speed of navigation through the site will also increase because if you frequently open the pages of the site, the browser no longer requests a page from the server.

Error: I met a lot of examples when the date of the document update was the current time at the time of the request to the page. It’s fundamentally wrong, because in the end you don’t get the proper operation of these headers, as a result, robots load every page without ever changing. In this case, the selected bypass limits will be quickly exhausted and indexing will be slow.

    2 answers 2

    Decision:

    1. configure the config (nginx in the if_modified_since exact server directive). http://nginx.org/ru/docs/http/ngx_http_core_module.html#if_modified_since so that the server sends these headers to the browser and the search engine robot.

    Restart the server.

    2. PHP code at the top index.php

    $LastModified_unix = $date_changed; // время последнего изменения страницы $LastModified = gmdate("D, d MYH:i:s \G\M\T", $LastModified_unix); $IfModifiedSince = ''; if (isset($_ENV['HTTP_IF_MODIFIED_SINCE'])){ $IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5)); } if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])){ $IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5)); } if ($IfModifiedSince && $IfModifiedSince >= $LastModified_unix) { header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified'); exit; } header('Last-Modified: ' . $LastModified); 

    3. Service header check : https://last-modified.com/ru/if-modified-since.html

    It is important to remember: after the introduction you get the correct crawling by search engines, but at the same time the pages without changes will age for search engines. But you will know for sure that the new and updated content will be quickly taken into account.

    We worked on the showers shop https://www.remontbistro.ru . The correct headers were implemented on it. If someone does not understand something, write prompt.

    • It seems to me no value in this information. Since basically they are looking for how to make lastmodify on a specific engine. And the link to the example is better to delete. - Alexander Semikashev 2:01 pm
    • Often it is necessary to deviate from the logic of standard CMS for various reasons, for example, to optimize speed and performance, develop new functionality, and implement modern search engine recommendations. It often comes to the conclusion that it is as if modern developers do not understand or deliberately don’t want to take into account the recommendations of search engines for page load speeds, document layouts, modern usability requirements. - Andy
    • As a result, you have to process it with a file, and in order to implement the final working solution, it is easier to check through an example using tools, as you can get an increase in the speed of loading pages and data completeness. Shared the solution because the setting is thin and dynamically variable, then there is something not so that the developers who are faced with such a situation quickly decide and do not slip. - Andy
    • Last modified and HTTP_IF_MODIFIED_SINCE are different entities: Last modified header is created in PHP, and HTTP_IF_MODIFIED_SINCE is variable appears after server settings, and when I looked for the solution I entered the search exactly like in Yandex and Google manuals, but I didn’t find the final step-by-step algorithm, especially with debugging tricks. Without understanding the complete chain of settings, many webmasters simply did not bother to enter the current time of the request to the document. - Andy

    Here is the if-modified-since service.

    down there is an example of code that needs to be integrated into your CMS or whatever you have. The server settings alone are not enough. Some CMS, for example Wordpress correctly give out if-modified-since with the caching module.