{"action":"created","issue":{"url":"https://api.github.com/repos/barryvdh/laravel-httpcache/issues/12","labels_url":"https://api.github.com/repos/barryvdh/laravel-httpcache/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/barryvdh/laravel-httpcache/issues/12/comments","events_url":"https://api.github.com/repos/barryvdh/laravel-httpcache/issues/12/events","html_url":"https://github.com/barryvdh/laravel-httpcache/issues/12","id":87640726,"number":12,"title":"Cache Control Header","user":{"login":"pchrysa","id":1962633,"avatar_url":"https://avatars.githubusercontent.com/u/1962633?v=3","gravatar_id":"","url":"https://api.github.com/users/pchrysa","html_url":"https://github.com/pchrysa","followers_url":"https://api.github.com/users/pchrysa/followers","following_url":"https://api.github.com/users/pchrysa/following{/other_user}","gists_url":"https://api.github.com/users/pchrysa/gists{/gist_id}","starred_url":"https://api.github.com/users/pchrysa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchrysa/subscriptions","organizations_url":"https://api.github.com/users/pchrysa/orgs","repos_url":"https://api.github.com/users/pchrysa/repos","events_url":"https://api.github.com/users/pchrysa/events{/privacy}","received_events_url":"https://api.github.com/users/pchrysa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-12T07:31:30Z","updated_at":"2015-06-17T18:55:10Z","closed_at":null,"body":"I have created an API with Laravel 5 and I want to setup HTTP Caching.\r\n\r\nI have the following method:\r\n\r\n    public function respond($data)\r\n    {\r\n        $response = response()->json($data, $this->getStatusCode());\r\n        $response->setTtl(config('constants.CACHE_TIME'));\r\n        return $response;\r\n    }\r\n\r\nwhich uses your package\r\n\r\nThe data, as I suppose, are cached because when I run an API call with postman to be cached for a time, if I add dd('test') or anything in the method in the meantime, it will not run until the time I have set passes. However, postman shows me the following:\r\n\r\nAge → 3 \r\nCache-Control → no-store, no-cache, must-revalidate, post-check=0, pre-check=0, public, s-maxage=50 \r\nConnection → Keep-Alive \r\nContent-Length → 44198 \r\nContent-Type → application/json \r\nDate → Thu, 11 Jun 2015 13:49:04 GMT \r\nExpires → Thu, 19 Nov 1981 08:52:00 GMT \r\nKeep-Alive → timeout=5, max=99 Pragma → no-cache\r\n\r\nHow can I make Cache-Control not to return \"no-store, no-cache, must-revalidate\" and the Pragma not to be \"no-cache\"?\r\n\r\nAny help will be appreciated.\r\n\r\nThank you in advance\r\n\r\nPS: Will the package be updated to Laravel 5.1?"},"comment":{"url":"https://api.github.com/repos/barryvdh/laravel-httpcache/issues/comments/112913250","html_url":"https://github.com/barryvdh/laravel-httpcache/issues/12#issuecomment-112913250","issue_url":"https://api.github.com/repos/barryvdh/laravel-httpcache/issues/12","id":112913250,"user":{"login":"cbakker","id":886975,"avatar_url":"https://avatars.githubusercontent.com/u/886975?v=3","gravatar_id":"","url":"https://api.github.com/users/cbakker","html_url":"https://github.com/cbakker","followers_url":"https://api.github.com/users/cbakker/followers","following_url":"https://api.github.com/users/cbakker/following{/other_user}","gists_url":"https://api.github.com/users/cbakker/gists{/gist_id}","starred_url":"https://api.github.com/users/cbakker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbakker/subscriptions","organizations_url":"https://api.github.com/users/cbakker/orgs","repos_url":"https://api.github.com/users/cbakker/repos","events_url":"https://api.github.com/users/cbakker/events{/privacy}","received_events_url":"https://api.github.com/users/cbakker/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T18:55:10Z","updated_at":"2015-06-17T18:55:10Z","body":"You can do that as follows:\r\n\r\n```php\r\n        $response->header('Cache-Control', 'no-store');\r\n        $response->header('Pragma', 'no-cache');\r\n```"}}