M
M
Maxim Tkachev2022-04-03 00:00:34
1C-Bitrix
Maxim Tkachev, 2022-04-03 00:00:34

How to set the Last-Modified header?

It is necessary to set the title for the sections of the catalog / product card equal to the date of the last modification.
placed the code in init.php

header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_modified_time).' GMT');

But so that I do not pass in $last_modified_time - the current time is always transmitted in the header when requested.
You can set this header in Bitrix. If possible how

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2022-04-04
@kikher

and why through init?
add a header to the component template, especially since these data are available there without additional functionality

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question