Welcome Guest, Not a member yet? Register   Sign In
Memcached CodeIgniter image manipulation class
#1

[eluser]Anestetikas[/eluser]
Hello,

Is it possible to store dynamically created images in memcached?

I have a few million images of various formats, jpegs tiffs, pngs. File sizes differs from around 1 to 100mb. At the moment I'm creating thumbs and needed sizes for display from originals using CI image manipulation with dynamic_output = TRUE. But I want to store viewed images in Memcached for quicker acquisition, because same few images are being looked at multiple times by the same user in a short period of time and doing dynamic_output takes a lot of time and CPU resources.

I'm trying to fiddle with memcached to see if I can improve overall performance so what I did is:

At the moment I'm saving resized image to disk store it into memcached and delete it.

What I want is to skip the part of disk and store it to memcached directly from CI image manipulation class.

Can this be done?
#2

[eluser]Aken[/eluser]
Is it possible? Yes. Is it any more beneficial than serving images from the hard disk? No.

Dynamic output is killing you, because you need to generate the image every single time. And why delete it after storing it to the disk? Is disk space that much of a concern?

I would set up something where if the requested image exists, then serve it. If it does not exist, then the script generates it, saves it, and serves it. Then it's only dynamically generated once, and can be cached like normal from then on.




Theme © iAndrew 2016 - Forum software by © MyBB