caching

Author Message

Rami Grossman

Monday 14 June 2004 10:28:58 am

can someone please explain me the meaning and usage of keys on the cache-block function?
I read about it on the documentation but the explanation there is very short

thanks a lot
Rami

Alex Jones

Tuesday 15 June 2004 6:20:39 am

The keys in a cache-block ensure that the contents of the cache-block are stored and named in a manner that is unique, so one cache-block won't overwrite another. Does that help?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Rami Grossman

Saturday 19 June 2004 7:58:33 pm

Thanks a lot Alex, this was very helpful

Marco Zinn

Sunday 20 June 2004 1:27:55 pm

My 2 cents, as i also had problems with this term:
The key(s) of a cache-block are used to uniquely identify, create and use that cache block, depending on the value of the cache block.

Example 1: You have a cache block, which should be cached individually for each user (User information or so). So, you would use the user ID as cache blocks key.
Example 2: You have a cache block, which should be cached individually for each webpage (Navigation and page path). So, you would use the URL as cache blocks key.
Example 3: You have a cache block, which should be cached individually for each website and for each role combination (role-depending Navigation and page path). So, you would use the URL and the role ID array as cache blocks keys.

Note:
The number of cache blocks created as files in the filesystem depends on the possible value combinations of all keys of that cache block:
For example 1: If you have 2000 users, you would get up to 2000 cache blocks
For example 2: If you have 10.000 webpages (different URLs), you would get up to 10.000 cache blocks
For example 3: If you have 2.000 users and 10.000 webpages (different URLs), you would get up to 2.000 x 10.000 = 20.000.000 cache blocks, as the cache block key is a combination of the two keys.

It would be nice, if some ezCrew member or ez Guru would tell us, if this is really true ;)

Marco
http://www.hyperroad-design.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.