caching - Laravel sending no-cache header -
i'm having trouble laravel 4. somehow header
cache-control: no-cache
is being sent in response on pages within site. can't find or how change it.
since affecting controllers i'm presenting view view::make
way change globally.
if want use cache, can change behavior in "response" object (returned controller method in example) :
public function mycontrollermethod() { $response = response::make('something'); $response->setlastmodified(new datetime("now")); $response->setexpires(new datetime("tomorrow")); return $response; }
it works in environnement, hope help.
edit:
if want set globally, can try (in app/start/
directory):
app::after(function($request, $response) { $response->setlastmodified(new datetime("now")); $response->setexpires(new datetime("tomorrow")); });
Comments
Post a Comment