mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 01:31:22 +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()
|
public function init()
|
||||||
{
|
{
|
||||||
HTTPCacheControl::inst()
|
HTTPCacheControl::singleton()
|
||||||
->enableCache()
|
->enableCache()
|
||||||
->setMaxAge(60); // 1 minute
|
->setMaxAge(60); // 1 minute
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ class MyPage_Controller extends Page_Controller
|
|||||||
public function myprivateaction($request)
|
public function myprivateaction($request)
|
||||||
{
|
{
|
||||||
$response = $this->myPrivateResponse();
|
$response = $this->myPrivateResponse();
|
||||||
HTTPCacheControl::inst()
|
HTTPCacheControl::singleton()
|
||||||
->disableCache();
|
->disableCache();
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
@ -160,7 +160,7 @@ class Page_Controller extends ContentController
|
|||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
HTTPCacheControl::inst()
|
HTTPCacheControl::singleton()
|
||||||
->enableCache($force=true) // DANGER ZONE
|
->enableCache($force=true) // DANGER ZONE
|
||||||
->setMaxAge(60); // 1 minute
|
->setMaxAge(60); // 1 minute
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ class Page_Controller extends ContentController
|
|||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
- HTTP::set_cache_age(60);
|
- HTTP::set_cache_age(60);
|
||||||
+ HTTPCacheControl::inst()
|
+ HTTPCacheControl::singleton()
|
||||||
+ ->enableCache()
|
+ ->enableCache()
|
||||||
+ ->setMaxAge(60); // 1 minute
|
+ ->setMaxAge(60); // 1 minute
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ class MyPage_Controller extends Page_Controller
|
|||||||
{
|
{
|
||||||
$response = $this->myPrivateResponse();
|
$response = $this->myPrivateResponse();
|
||||||
- HTTP::set_cache_age(0);
|
- HTTP::set_cache_age(0);
|
||||||
+ HTTPCacheControl::inst()
|
+ HTTPCacheControl::singleton()
|
||||||
+ ->disableCache();
|
+ ->disableCache();
|
||||||
|
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ class Page_Controller extends ContentController
|
|||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
- HTTP::set_cache_age(60);
|
- HTTP::set_cache_age(60);
|
||||||
+ HTTPCacheControl::inst()
|
+ HTTPCacheControl::singleton()
|
||||||
+ ->enableCache($force=true) // DANGER ZONE
|
+ ->enableCache($force=true) // DANGER ZONE
|
||||||
+ ->setMaxAge(60); // 1 minute
|
+ ->setMaxAge(60); // 1 minute
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user