IMPR: Cache control

This commit is contained in:
Tony Air 2024-06-19 20:29:14 +02:00
parent 7995d46cb6
commit c78ef9f435

View File

@ -29,7 +29,7 @@ class PageController extends ContentController
protected function init() protected function init()
{ {
HTTPCacheControlMiddleware::singleton() HTTPCacheControlMiddleware::singleton()
->enableCache() ->enableCache(true)
// 1 minute // 1 minute
->setMaxAge(60); ->setMaxAge(60);
@ -76,7 +76,7 @@ class PageController extends ContentController
// inject AJAX processing // inject AJAX processing
if (Director::is_ajax()) { if (Director::is_ajax()) {
HTTPCacheControlMiddleware::singleton() HTTPCacheControlMiddleware::singleton()
->disableCache(); ->disableCache(true);
return AjaxControllerEx::processAJAX($tpls); return AjaxControllerEx::processAJAX($tpls);
} }