[#8024] Reduce session size by improving registry caching
Summary Reduce session size by improving registry caching
Queue Horde Framework Packages
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Requester slusarz (at) horde (dot) org
Created 2009-02-23 (4347 days ago)
Updated 2009-03-12 (4330 days ago)
Resolved 2009-03-12 (4330 days ago)
Patch No

2009-03-12 21:14:17 Michael Slusarz State ⇒ Resolved
2009-03-05 07:15:24 Michael Slusarz Comment #3
State ⇒ Feedback
Reply to this comment
Coding complete.  Leaving open for feedback/bug reports.
2009-02-23 19:38:38 Michael Slusarz Comment #1
Type ⇒ Enhancement
State ⇒ Accepted
Priority ⇒ 1. Low
Summary ⇒ Reduce session size by improving registry caching
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
At present, cached registry data takes up a large percentage of 
session data.  e.g. - quick benchmark on load of IMP 5 shows session 
size (obtained via strlen(serialize($_SESSION))) to be approx. 70 K.   
Of this, registry cache is approx. 25 K (this installation only has 
imp, turba, and chora active).

Most of this registry data is not used in any given page access, let 
alone ever in the session.  So it would be best to cache only the 
registry info that has actually be used in the session, and offload 
the rest to a shared memory location where it can be accessed, but 
doesn't pollute every user's session.

Initial thoughts is to use Horde_Cache or sqlite.  Horde_cache has the 
advantage that it does not need to be complied into server like sqlite 
does (sqlite requires various modules to be loaded via php.ini).  But 
cache should be local to the particular server rather than global.


On load, create the registry cache object for the user and get an md5 
sum of it.

Store this sum in session data.

Store registry cache data if it does not already exist.

Load registry cache object into memory as needed (Horde_Cache) or use 
SQL commands (sqlite) to obtain cache information.

For any registry cache info used, store this data in session.   
increased storage size offset by reduced costs of obtaining cache 
information from cache store (assumption is that if Horde code needs 
registry cache info once, it will need the same code/info on 
subsequent page loads).

Saved Queries