Реализация ETAG в Magento2Php

Кемеровские программисты php общаются здесь
Anonymous
Реализация ETAG в Magento2

Сообщение Anonymous »

Этот код, который я использую для установки ETAG в заголовке, я могу установить ETAG в заголовке ответа, но если не менее матч всегда остается пустым. 1. Nginx Server 2. Magento версия - 2.4.8 -p1
$etag = md5($category->getId();

$etagHeader = 'W/"' . $etag . '"';

$this->response->setHeader('Etag', $etagHeader, true);
$this->response->setHeader('Cache-Control', 'public, max-age=3600', true);
$this->response->setHeader('Pragma', 'cache', true);

if (trim($this->request->getHeader('If-None-Match')) === $etag) {
$logger->info('ETag matches, returning 304');
$this->response->setHttpResponseCode(304);
$this->response->clearBody();
}


Подробнее здесь: https://stackoverflow.com/questions/797 ... n-magento2

Вернуться в «Php»