我有一个 TYPO3 9.5.0LTS 并使用引导程序包主题。似乎一切正常……我定义了站点配置,然后我得到了漂亮的 url……但我经常收到这样的错误消息:
核心:异常处理程序(WEB):未捕获的TYPO3异常:#1436717266:标头“Expire”的标头值无效。该值必须是字符串或字符串数组。|文件/is/www/typo3_src-9.5中引发的InvalidArgumentException .0/typo3/sysext/core/Classes/Http/Message.php 在第 208 行。请求的 URL:domain/content-examples/media/audio
是什么原因导致这种情况以及如何防止这种情况发生?
编辑:可能是第 4244 行 TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getHttpHeadersForTemporaryContent() 中的这一部分:
/**
* Returns HTTP headers for temporary content.
* These headers prevent search engines from caching temporary content and asks them to revisit this page again.
* Please ensure to also send a 503 HTTP Status code with these headers.
*/
protected function getHttpHeadersForTemporaryContent(): array
{
return [
'Retry-after' => '3600',
'Pragma' => 'no-cache',
'Cache-control' => 'no-cache',
'Expire' => 0,
];
}
...所以我将其更改为 'Expires' => 0