imagecache icon indicating copy to clipboard operation
imagecache copied to clipboard

Cache not work when data fetch using curl?

Open Xinecraft opened this issue 3 years ago • 0 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.

Xinecraft avatar Jan 26 '23 17:01 Xinecraft