Hello JCS users and developers,

I just put our first JCS enabled site up to production and the pages
using the cache are loading *much* faster.  Thanks for making JCS!

I have some questions as to the 'right way' to do some things in JCS.


A) Currently, I am putting Torque objects into the cache.  Is this bad? 
Are they serializable?
 
I suppose it would be 'cleaner' to write a Bean to represent every
cached entity in my system instead of using Torque objects, and then put
the Beans in the cache, but it just seems like more work and QA.  Plus,
when I get a Torque object in-hand, I allow the .vm to traverse as much
of the data tree it needs to display what it wants to show (with the
built-in torque accessors).  It's so convenient.

Note that this causes my JCS cache to continually grow (and also get
faster), as the Torque objects themselves cache things they load.


B) What's the best way to keep the results of different groupings of the
same/similar objects in the cache.

For example, I have a set of Customer objects that are grouped many
different ways for display on our website.  For example, on some pages
the active customers are listed alphabetically, on others I show a few
of them at random, and on another they're shown by category.  On yet
other pages, I only show a subset of them based on different criteria.

Currently this is all handled by different selects straight from the
database, which I want to avoid.

Right now I'm putting lists and maps in the cache for each grouping,
like 'AllCustomers', 'Advertisers', 'CustomersByAlphabet', etc.  This
means, however, that whenever anyone adds or removes an object from the
CustomerCache, or there is a cache miss, I rebuild all these lists
(which takes about 3-4 seconds).  I also only want one instantiation of
each entity actually in the cache at any time, even if it's pointed to
by different groups.

I believe the 'groups' feature in JCS is supposed to help with this, but
I've seen messages that that's not ready for prime time.  Also, the
correct way to use the groups wasn't obvious enough for me to try that
right out of the gate.  Any comments or code samples out there?


Thanks for any help, and thanks for the great system!


Jeff Jones
www.franchise.com



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to