|Re: Cache images system for Gallery widget [message #598125 is a reply to message #479527]
||Tue, 11 August 2009 12:52
| Nicolas Richeton
Registered: July 2009
What kind of cache do you need exactly ?
I've implemented several levels of caching in ShareMedia which was the original project of the Gallery widget (http://blog.richeton.com/sharemedia).
Basically, I use a reference counting service on images, which keeps images in memory a few seconds after all references have been released. This saves a lot of image loading because I'm able to reuse a lot of them from memory.
On the Gallery side, I have a custom image renderer which uses a size-limited cache based on the reference counting service. I set a maximum number of image for the gallery (let's say 400). The cache keeps references on images. When more image are loaded, the references on the older ones are released. This way, only images which stay out of the client view for several seconds get disposed.
I'm in the process of releasing this service/cache as a separate project. Help is welcome :)
Powered by FUDForum
. Page generated in 0.01630 seconds