Turns off Caching for JSON responses

Adds headers to json response to avoid caching of the response
pull/680/head
Luke Stevenson 3 weeks ago committed by GitHub
parent ab323cffff
commit d288892c30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -934,6 +934,9 @@ class Engine
$this->response() $this->response()
->status($code) ->status($code)
->header('Content-Type', 'application/json') ->header('Content-Type', 'application/json')
->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->header('Pragma', 'no-cache')
->header('Expires', '0')
->write($json); ->write($json);
if ($this->response()->v2_output_buffering === true) { if ($this->response()->v2_output_buffering === true) {
$this->response()->send(); $this->response()->send();

Loading…
Cancel
Save