mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
DOCS Fix bad usage of HTTPCacheControl::inst()
This commit is contained in:
parent
1acb80851c
commit
936fd775c5
@ -103,7 +103,7 @@ class Page_Controller extends ContentController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
HTTPCacheControl::inst()
|
||||
HTTPCacheControl::singleton()
|
||||
->enableCache()
|
||||
->setMaxAge(60); // 1 minute
|
||||
|
||||
@ -130,7 +130,7 @@ class MyPage_Controller extends Page_Controller
|
||||
public function myprivateaction($request)
|
||||
{
|
||||
$response = $this->myPrivateResponse();
|
||||
HTTPCacheControl::inst()
|
||||
HTTPCacheControl::singleton()
|
||||
->disableCache();
|
||||
|
||||
return $response;
|
||||
@ -160,7 +160,7 @@ class Page_Controller extends ContentController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
HTTPCacheControl::inst()
|
||||
HTTPCacheControl::singleton()
|
||||
->enableCache($force=true) // DANGER ZONE
|
||||
->setMaxAge(60); // 1 minute
|
||||
|
||||
|
@ -113,7 +113,7 @@ class Page_Controller extends ContentController
|
||||
public function init()
|
||||
{
|
||||
- HTTP::set_cache_age(60);
|
||||
+ HTTPCacheControl::inst()
|
||||
+ HTTPCacheControl::singleton()
|
||||
+ ->enableCache()
|
||||
+ ->setMaxAge(60); // 1 minute
|
||||
|
||||
@ -141,7 +141,7 @@ class MyPage_Controller extends Page_Controller
|
||||
{
|
||||
$response = $this->myPrivateResponse();
|
||||
- HTTP::set_cache_age(0);
|
||||
+ HTTPCacheControl::inst()
|
||||
+ HTTPCacheControl::singleton()
|
||||
+ ->disableCache();
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ class Page_Controller extends ContentController
|
||||
public function init()
|
||||
{
|
||||
- HTTP::set_cache_age(60);
|
||||
+ HTTPCacheControl::inst()
|
||||
+ HTTPCacheControl::singleton()
|
||||
+ ->enableCache($force=true) // DANGER ZONE
|
||||
+ ->setMaxAge(60); // 1 minute
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user