mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
IMPR: Cache control
This commit is contained in:
parent
7995d46cb6
commit
c78ef9f435
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user