Intervention / imagecache

Caching extension for the Intervention Image Class

Home Page:https://image.intervention.io/v2/usage/cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cache not work when data fetch using curl?

Xinecraft opened this issue · comments

commented

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.