Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Slow cache? #38

Open
simplenotezy opened this issue Feb 28, 2015 · 23 comments
Open

Slow cache? #38

simplenotezy opened this issue Feb 28, 2015 · 23 comments

Comments

@simplenotezy
Copy link

I just installed the library. Hitting the route:

{route}/{template}/{filename}

Is extremely slow. It takes 500ms or so, compared to direct image source which is 20ms or so.

I wonder if the image is even cached. I suspect not. Using memcached as driver on a Laravel 5 installation.. How to debug further?

@simplenotezy
Copy link
Author

On a page with 10-20 images, they take 10-15 seconds to load, and some of them even fail, like this:

image

@simplenotezy
Copy link
Author

I've made a comparison:

Using imagecache:
image
image

Using direct image source:
image
image

@olivervogel
Copy link
Member

I suggest to create a XDebug profile, to discover what is causing this delay.

@ghost
Copy link

ghost commented Mar 26, 2015

canflax. Have the same problem, its faster to load image full size then cache'em. Please reply here if you find an answer! same for me

@DoubleTime
Copy link

Facing same issue, almost extra 60-70ms in time latancy.

This is the code how I load the image at Route.php

Route::get('images/cars/{src}', function ($src){    
    $cacheimage = Image::cache(function($image) use($src){
        return $image->make("images/products/".$src);
    },1440);

    return Response::make($cacheimage,200, array('Content-Type'=>'image/jpg'));
});

In blade

<img src="{{ URL::asset('/images/cars/theimage.jpg' }}" alt="">

Any thought? Using laravel 4 btw.

@mehrdd
Copy link

mehrdd commented Apr 4, 2015

+1
is there any simple todo for real cache ?
i mean create a real thumbnail with Intervention's library.

@tshafer
Copy link

tshafer commented Apr 9, 2015

+1 I am also facing this issue. I am using it this way. http://image.intervention.io/use/url

@olivervogel
Copy link
Member

I'm again suggesting to create a XDebug profile, to discover what exactly is causing this delay.

@tshafer
Copy link

tshafer commented Apr 9, 2015

Sorry about that.

Ill give it a try

@mosh-tudor
Copy link

Yep, getting pics from cache are so slow! Slow like first resizing.
http://c2n.me/3gUFhhr.jpg

@mosh-tudor
Copy link

NOTE!
Images from cache (I mean this script) have always HTTP status code 200,
in normal situation images must have HTTP status code 304.

I hope olivervogel will fix this!)

@jhellingman
Copy link

+1 Same issue with similar code.

@rogerfn
Copy link

rogerfn commented Jun 8, 2015

People, any thoughts on it?

@Nikita240
Copy link

+1 same issue, even though it does create cached image files in the storage, and the Image::cache function is returning a CachedImage object.

@jhellingman
Copy link

The issue is that the entire framework needs to be loaded for each image being retrieved, and that action is actually slower than most image manipulations. Resolved by generating direct urls to generated images, and let the server pull them directly from the cache, without use of the framework. Since the types of manipulations I want are very limited, I can keep the URLs to them in my database and write them out to generated pages. My conclusion: I have no need for this framework.

@aske-cph
Copy link

+1 - Seems a tad useless for now.

Loading 8 images is very slow for me on a regular digital ocean droplet
It can sometimes take over 6 seconds to load a small group of images.

Sometimes the server hangs and loads all of the images at the same time. And i can see that the CPU spikes like crazy on the server, even though the images are cached.

I am going to just create a command in Laravel that creates the thumbs with intervention, and delegates the generated thumbs and different sizes to appropriate folders instead of relying on this for now...

@thanhmabo
Copy link

I also has same problem, see my cache image, actually slowly http://www.thanhmabo.com/post

@cmnstmntmn
Copy link

any update on this ?

@wi-development
Copy link

wi-development commented Oct 2, 2016

hello? always return 200, how to fix this?

@sunnyjayjay
Copy link

I agree. The caching is very much slower than loading the images directly. Is this problem going to be resolved or do we need to find another image caching solution?

@stephan-v
Copy link

Still slow as fuck, don't use this package.

@hijaumuda
Copy link

it's been 4 years, and still slow 👎

@theprobugmaker
Copy link

theprobugmaker commented Dec 16, 2019

Have anyone found a solution or an alternative for this? @olivervogel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests