6.0.0-alpha12
6/12/25

[#6981] Statically cache images and galleries
Summary Statically cache images and galleries
Queue Ansel
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester duck (at) obala (dot) net
Created 06/26/2008 (6195 days ago)
Due
Updated 07/05/2008 (6186 days ago)
Assigned 06/26/2008 (6195 days ago)
Resolved 07/05/2008 (6186 days ago)
Milestone
Patch No

History
07/05/2008 04:31:02 PM Michael Rubinsky Comment #15
State ⇒ Resolved
Reply to this comment
Removed the destroy() method, it's never called, and even if we were 
to call it, it would serve no purpose since the only logical place to 
use it would be at the end of script execution, when all objects are 
destroyed anyway.  The article mentioned refers to removing circular 
references when objects go out of scope and are unused - these are not 
circular references nor do we know for sure when we want to destroy 
them, other then at request shutdown.
07/05/2008 04:27:03 PM CVS Commit Comment #14 Reply to this comment
Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/ansel/lib/Ansel.php?r1=1.458&r2=1.459&ty=u
07/02/2008 04:37:52 AM Chuck Hagenbuch Comment #13 Reply to this comment
I don't see where you are calling your new Ansel_Storage::destroy()
method anywhere in the code. Where is this intended to be called?
http://www.alexatnet.com/node/73
Eh? The method still needs to be called to be useful...
07/02/2008 04:30:20 AM Duck Comment #12 Reply to this comment
I don't see where you are calling your new Ansel_Storage::destroy()
method anywhere in the code. Where is this intended to be called?
http://www.alexatnet.com/node/73
07/01/2008 05:43:12 PM Michael Rubinsky Comment #11
State ⇒ Feedback
Reply to this comment
I don't see where you are calling your new Ansel_Storage::destroy() 
method anywhere in the code. Where is this intended to be called?
07/01/2008 05:34:56 PM Michael Rubinsky Comment #10
State ⇒ Resolved
Reply to this comment
Committed, thanks.
07/01/2008 05:32:59 PM CVS Commit Comment #9 Reply to this comment
Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/ansel/lib/Ansel.php?r1=1.452&r2=1.453&ty=u
07/01/2008 05:08:09 PM Michael Rubinsky Comment #8 Reply to this comment
What about doing something like
http://schlitt.info/applications/blog/index.php?/archives/605-Hierarchical-caching.html and adding a local-memory cache? That way the cache could transparently handle things that should be returned from local memory, then fall back to memcache (if enabled), then fall back 
to
disk/sql.
For the record, this won't go into Ansel, but into Framework. Probably 
for Horde 4. See Ticket: 6996
06/30/2008 05:12:40 PM Duck Comment #7
New Attachment: Ansel-static.diff Download
Reply to this comment
Ah. Makes sense.  I'd prefer to keep the Gallery Cache though
Done
06/26/2008 05:27:43 PM Chuck Hagenbuch Comment #6 Reply to this comment
What about doing something like 
http://schlitt.info/applications/blog/index.php?/archives/605-Hierarchical-caching.html and adding a local-memory cache? That way the cache could transparently handle things that should be returned from local memory, then fall back to memcache (if enabled), then fall back to 
disk/sql.
06/26/2008 04:14:49 PM Michael Rubinsky Comment #5
Assigned to Michael Rubinsky
Summary ⇒ Statically cache images and galleries
State ⇒ Assigned
Reply to this comment
Ah. Makes sense.  I'd prefer to keep the Gallery Cache though - it can 
still be turned off in the config if that is desired and l want to 
look and see what code paths would lead to the images that are pulled 
from getImages() to be accessed again on the same page....I'd hate to 
always cache the image object on every gallery page load...that is a 
lot of images, with the image data already loaded, to keep in memory.
06/26/2008 03:18:17 PM Duck Comment #4 Reply to this comment
you are hitting the cache (ex. an remote memcached server) multiply 
times on the same page for the same gallery.
06/26/2008 03:00:34 PM Michael Rubinsky Comment #3
State ⇒ Feedback
Reply to this comment
The cache holds galleries requested by ALL users so you can get a hit 
on the cache by a user that is requesting a particular gallery for the 
first time if another user already requested it, your patch can end up 
having to retrieve (and store in memory) the same gallery from the DB 
once for every user instead of only when the gallery cache is expired. 
  What is the performance issue with using the cache?  If you choose 
not to use the cache, that's what the cache configuration parameter in 
Ansel is for. Or am I missing something?
06/26/2008 02:27:12 PM Duck Comment #2
New Attachment: Ansel.diff Download
Reply to this comment
And of course the pach :)



The patch removes the use of Horde_Cache for galleries but it can be 
left, if you think that is better, But static calls should be added 
for sure.
06/26/2008 02:25:16 PM Duck Comment #1
Priority ⇒ 1. Low
State ⇒ New
Patch ⇒ No
Milestone ⇒
Summary ⇒ Staticaly images and galleries
Type ⇒ Enhancement
Queue ⇒ Ansel
Reply to this comment
In practice came out that is not so good to store galleries in cache. 
As the gallery is requestioned multiply times in the page the cache is 
called multiply times too. Is better to statically handle galleries. 
The patch replaces the cache storage witch classic static calls and 
and move the static images container in the the main Ansel_Storage 
level so it can be filled by others functions.

Saved Queries