Cache not work when data fetch using curl?
Xinecraft opened this issue · comments
Hi,
If I fetch data from a URL using Request::get() and then pass it to the cache, caching won't work in that case? It's not working for me.
Eg:
$img = Image::cache(function ($image) use ($param) {
$url = "https://someurl.com/$param";
$data = Http::get($url)->body();
return $image->make($data);
}, 60, true);
I am using this way because passing directly the URL to $image->make(URL) slow down the request by a lot in php-fpm idk why.