В настройках компонента catalog.section (если он «из коробки») есть параметр SET_LAST_MODIFIED
protected function checkLastModified($element)
{
if ($this->arParams['SET_LAST_MODIFIED'])
{
$time = DateTime::createFromUserTime($element['TIMESTAMP_X']);
if (
!isset($this->arResult['ITEMS_TIMESTAMP_X'])
|| $time->getTimestamp() > $this->arResult['ITEMS_TIMESTAMP_X']->getTimestamp()
)
{
$this->arResult['ITEMS_TIMESTAMP_X'] = $time;
}
}
}
protected function initMetaData()
{
...
if ($this->arParams['SET_LAST_MODIFIED'] && $this->arResult['ITEMS_TIMESTAMP_X'])
{
Main\Context::getCurrent()->getResponse()->setLastModified($this->arResult['ITEMS_TIMESTAMP_X']);
}
}