php - How to serialize a view response? -


i'm working on (unfortunately no 1 responded):

https://stackoverflow.com/questions/31057493/laravel-caching-while-using-ajax

i've changed code cachefilter.php this:

public function fetch(route $route, request $request) {     $key = $this->makecachekey($request);      if( cache::has($key) ) return cache::get($key); }  public function put(route $route, request $request, response $response) {     $key = $this->makecachekey($request);      if( !cache::has($key) ) cache::put($key, $response->getoriginalcontent(), 60); }  protected function makecachekey(request $request) {     $ajaxrequest = json_encode($request->ajax());      if($ajaxrequest == 'true') {         return 'ajax_route_' . str::slug($request->url());     }     else {         return 'route_' . str::slug($request->url());     } } 

i'm getting error:

serialization of 'closure' not allowed 

from following line of code:

if( !cache::has($key) ) cache::put($key, $response->getoriginalcontent(), 60); 

how can serialize view response make work?


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -