21307 Posts in 5737 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 323 Views |
-
HTTP Response

17 February 2012 at 12:32am
I have 2 questions:
How can you use your own instance of SS_HTTPResponse as the http response? I tried:
$a = new SS_HTTPResponse();
$a->addHeader("Cache-Control", "no-store");
$a->output();I also tried to not use $a->output() and instead pass $a to HTTP::add_cache_headers. No luck.
The problem is that Chrome do not react on "Cache-Control: no-cache" but needs "Cache-Control: no-store" instead.
The second question is why "no-store" isn't used in live mode, when it is used in dev mode? no-cache is used in live mode aswell as in dev mode, which signals that the absence of no-store in live mode is a human error?
Thanks in advance,
Jacob -
Re: HTTP Response

20 February 2012 at 7:46pm
If you're in a controller you should be able to use $this->request->addHeader() to alter the current responses headers.
http://api.silverstripe.org/2.4/sapphire/control/SS_HTTPResponse.html#methodaddHeaderIf you wish to alter the creation of Request objects see
http://api.silverstripe.org/2.4/sapphire/control/Controller.html#methodhandleRequest
| 323 Views | ||
|
Page:
1
|
Go to Top |


