6.0.0-beta1
7/8/25

[#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
Owners
Requester slusarz (at) horde (dot) org
Created 02/23/2009 (5979 days ago)
Due
Updated 03/12/2009 (5962 days ago)
Assigned
Resolved 03/12/2009 (5962 days ago)
Milestone
Patch No

History
03/12/2009 09:14:17 PM Michael Slusarz State ⇒ Resolved
 
03/05/2009 07:15:24 AM Michael Slusarz Comment #3
State ⇒ Feedback
Reply to this comment
Coding complete.  Leaving open for feedback/bug reports.
02/23/2009 07:38:38 PM Michael Slusarz Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Reduce session size by improving registry caching
Type ⇒ Enhancement
State ⇒ Accepted
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.



Pseudocode:

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