What this solution does
The module generates HTTP headers Last-Modified and 304 Not Modified to accelerate the indexing of an online store by search engines. The Last-Modified header informs the browser or crawler of the page's last modification time. On a subsequent request, if the page is cached locally, the client adds the If-Modified-Since header with that date. The server compares this timestamp with the current modification time. If the page has not changed, it returns a 304 Not Modified response without sending the page body, images, or other objects.
BX365 Module: Installation and Configuration of Last Modified and 304 Not Modified
Installing this module significantly reduces server load, potentially by 30% or more. This optimization is particularly relevant for websites with high traffic and long user session durations.
The module accelerates indexing by search engines. Both Yandex and Google recommend sending the Last-Modified header and correctly handling the If-Modified-Since request in their webmaster guidelines.
The document modification date update process operates as follows. Upon a page request, the module processes the text content located between the body tags, having first removed scripts, styles, and HTML markup. An MD5 hash is calculated for the remaining text and compared with the previously stored value. If the hashes differ, the document is considered changed, and the modification date is updated. If the hashes are equal, the document is unchanged, the modification date is not updated, and the previously stored value is returned.
Module Settings
- Disable module. Completely deactivates the module functionality.
BX365 Module: Last Modified and 304 Not Modified Configuration
Enable logging. When activated, a log file named bx365_modified_log.txt is created in the /upload/ directory.
Exclude domains. Enter a single domain or a comma-separated list of domains for which Last Modified and 304 Not Modified headers will not be set.
Exclude specific pages. Enter URL addresses for pages where these headers should not be applied. Each address must be on a new line. Examples: /auth/, /basket/, /login/, /order/, /personal/
Exclude user groups. Select user groups for which Last Modified and 304 Not Modified headers will not be generated.
Ignore GET parameters. Disable the consideration of GET parameters in the URL string when determining headers.
Configure static block processing. Specify CSS classes for static HTML blocks containing text content (such as news descriptions, product details, or service characteristics) that require processing. Enter each class on a new line.
The module allows excluding dynamic HTML blocks from the analysis of a page's text content. To do this, specify the class names of elements to be excluded, each on a new line. Any dynamic blocks can be removed, such as shopping cart widgets, product filters, or contact forms.
The cache clearing function removes previously calculated module data, including URL addresses, document modification dates, and MD5 hashes.
Module operation features
The module does not process requests to pages in the /bitrix/ and /upload/ directories, including all nested subfolders. Requests made via the POST method, AJAX requests, and 404 errors are also excluded from processing.
Handling of GET parameters in the URL string is enabled by default but can be disabled in the module settings. For a single page with different sets of GET parameters, different document modification dates will be generated.
The module correctly integrates with the standard functionality to set the page modification time in response headers, inserting the date calculated by the module.
Module functionality is not guaranteed when the composite mode (Composite Site technology) is enabled.
BX365 Module: Installation and configuration of Last-Modified and 304 Not Modified headers.
If the module is not working, you must exclude the influence of third-party scripts by testing the Last-Modified header functionality on the server. Upload the test file LastModified.php to your site's root directory. Open this file in a browser and run the check.
If the test fails, it means the server hosting your site has these headers disabled. For users with an ISP panel, try disabling SSI in the Additional Settings section of the site. In other cases, contact your hosting provider's technical support, provide the link to the test file, and state that the Last-Modified header is not being sent to the client.
If the test file passes but the Last-Modified header is not set on the site, contact technical support to investigate the cause.
For “BX365: Installation and Configuration of Last Modified, 304 Not Modified”, General iT can perform integration, configuration and a final check after installation.