Support the ongoing development of Laravel.io →
Configuration Cache Packages

I'm trying to serve a cached image but I'm only getting a broken image link. How come?

$cachedImage = Image::cache(function($img) {
			return $img->make('http://cdn.smosh.com/sites/default/files/ftpuploads/bloguploads/twilight-meme-scumbag-edward.jpg');
		}, 10, true);

return Response::make($cachedImage, 200, array('Content-Type' => $cachedImage->mime));

This is my result: Image

And this should be the result: Image

Have anyone experienced the same before?

Last updated 2 years ago.
0

I know this is old, but true returns the Intervention object on the cache function.

So now you can just return $cachedImage->response();

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

RoffeDH roffedh Joined 7 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.