laravel - store API response data on cache on server php -


i using api. resquest-response time on api takes long time. so, due problem, want store response on server not on browser. because, want display result cache similar searches. know, there limitations on accuracy on cached data, that's part don't want include here.

i using laravel framework , using code current moment in laravel documentation.

$expiresat = carbon::now()->addminutes(10);  cache::put('key', 'value', $expiresat); 

the problem code is, stores cache on browser only. want store on server. have heard memcached not implement it. have heard of apc_store() think stores on local. so, how can store cache on server?

similar cache::put(), can use cache::pull() check data saved (on server).

// check cache data $cacheddata = cache::pull($key);  // new data if no cache if (! $cacheddata) {      $newdata = 'new data';     $expiresat = carbon::now()->addminutes(10);      // save new data cache     $cacheddata = cache::put($key, $newdata, $expiresat); }  echo $cacheddata; 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -