disableCache() public method

Sets the correct headers to instruct the client to not cache the response
public disableCache ( ) : void
return void
Beispiel #1
0
 /**
  * Tests the disableCache method
  *
  * @return void
  */
 public function testDisableCache()
 {
     $response = new Response();
     $expected = ['Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate("D, d M Y H:i:s") . " GMT", 'Cache-Control' => 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'];
     $response->disableCache();
     $this->assertEquals($expected, $response->header());
 }