Skip to content

Instantly share code, notes, and snippets.

@slakbal
Forked from zackify/filters.php
Created May 6, 2014 11:15
Show Gist options
  • Save slakbal/6f8998289349baa1925e to your computer and use it in GitHub Desktop.
Save slakbal/6f8998289349baa1925e to your computer and use it in GitHub Desktop.
App::before(function($request)
{
$key = Str::slug($request->url());
if(Cache::has($key)) return Cache::get($key);
});
App::after(function($request, $response)
{
$key = Str::slug($request->url());
if( ! Cache::has($key)) Cache::put($key, $response->getContent(),Config::get('cache.time'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment