Skip to content

Time to live error

In my magento (2.4.6-p5, with Varnish and Redis) I keep getting following error in exception.log:

[2024-05-15T18:23:57.623784+00:00] main.CRITICAL: InvalidArgumentException: Time to live is a mandatory parameter for set public headers in /home/www/sklepy/mag/vendor/magento/framework/App/Response/Http.php:137
Stack trace:
#0 /home/www/sklepy/mag/generated/code/Magento/Framework/App/Response/Http/Interceptor.php(41): MagentoFrameworkAppResponseHttp->setPublicHeaders()
#1 /home/www/sklepy/mag/vendor/magento/module-page-cache/Controller/Block/Esi.php(33): MagentoFrameworkAppResponseHttpInterceptor->setPublicHeaders()
#2 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(58): MagentoPageCacheControllerBlockEsi->execute()
#3 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(138): MagentoPageCacheControllerBlockEsiInterceptor->___callParent()
#4 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(153): MagentoPageCacheControllerBlockEsiInterceptor->MagentoFrameworkInterception{closure}()
#5 /home/www/sklepy/mag/generated/code/Magento/PageCache/Controller/Block/Esi/Interceptor.php(23): MagentoPageCacheControllerBlockEsiInterceptor->___callPlugins()
#6 /home/www/sklepy/mag/vendor/magento/framework/App/Action/Action.php(111): MagentoPageCacheControllerBlockEsiInterceptor->execute()
#7 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppActionAction->dispatch()
#8 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(138): MagentoPageCacheControllerBlockEsiInterceptor->___callParent()
#9 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(153): MagentoPageCacheControllerBlockEsiInterceptor->MagentoFrameworkInterception{closure}()
#10 /home/www/sklepy/mag/generated/code/Magento/PageCache/Controller/Block/Esi/Interceptor.php(32): MagentoPageCacheControllerBlockEsiInterceptor->___callPlugins()
#11 /home/www/sklepy/mag/vendor/magento/framework/App/FrontController.php(245): MagentoPageCacheControllerBlockEsiInterceptor->dispatch()
#12 /home/www/sklepy/mag/vendor/magento/framework/App/FrontController.php(212): MagentoFrameworkAppFrontController->getActionResponse()
#13 /home/www/sklepy/mag/vendor/magento/framework/App/FrontController.php(146): MagentoFrameworkAppFrontController->processRequest()
#14 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch()
#15 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent()
#16 /home/www/sklepy/mag/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}()
#17 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(135): MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch()
#18 /home/www/sklepy/mag/vendor/mirasvit/module-cache-warmer/src/CacheWarmer/Plugin/Debug/OnHitPlugin.php(145): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}()
#19 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(135): MirasvitCacheWarmerPluginDebugOnHitPlugin->aroundAroundDispatch()
#20 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(153): MagentoPageCacheModelAppFrontControllerBuiltinPluginInterceptor->MagentoFrameworkInterception{closure}()
#21 /home/www/sklepy/mag/generated/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin/Interceptor.php(23): MagentoPageCacheModelAppFrontControllerBuiltinPluginInterceptor->___callPlugins()
#22 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(135): MagentoPageCacheModelAppFrontControllerBuiltinPluginInterceptor->aroundDispatch()
#23 /home/www/sklepy/mag/vendor/swissup/module-amp/Plugin/Framework/FrontController.php(48): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}()
#24 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(135): SwissupAmpPluginFrameworkFrontController->aroundDispatch()
#25 /home/www/sklepy/mag/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}()
#26 /home/www/sklepy/mag/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins()
#27 /home/www/sklepy/mag/vendor/magento/framework/App/Http.php(116): MagentoFrameworkAppFrontControllerInterceptor->dispatch()
#28 /home/www/sklepy/mag/generated/code/Magento/Framework/App/Http/Interceptor.php(23): MagentoFrameworkAppHttp->launch()
#29 /home/www/sklepy/mag/vendor/magento/framework/App/Bootstrap.php(264): MagentoFrameworkAppHttpInterceptor->launch()
#30 /home/www/sklepy/mag/pub/index.php(30): MagentoFrameworkAppBootstrap->run()
#31 {main} {"report_id":"8f78ac444bac13c54f4aeb15a2b329f4773be7a2653a582cbfbb10980f5de8fe","exception":"[object] (InvalidArgumentException(code: 0): Time to live is a mandatory parameter for set public headers at /home/www/sklepy/mag/vendor/magento/framework/App/Response/Http.php:137)"} []

TTL settings have been checked double/triple times. Is something more hidden in Magento code or maybe 3rd party modules or PHP may affect this setting? Clearing and flushing cache doesn’t help. How to fix it?