Re: Cache Elements for Different Users

2007-08-13 Thread alan
The following component (+example controller using it) might help... I use it a lot. === http://bakery.cakephp.org/articles/view/ecache-easy-per-user-or-per-anything-cache-of-html-or-arrays Caching is basically required for any data-heavy or interaction-heavy site... but you need to

Re: Cache Elements for Different Users

2007-07-13 Thread inVINCable
Ketan Patel, I am attempting to do the exact same thing and am running into trouble. How exactly are you setting the $userid variable? What I have done is in my view, set it up like this, $session-read('User.id), so the user id is set there, and then something like $this- element('tagCloud',

Re: Cache Elements for Different Users

2007-07-13 Thread Ketan Patel
Well, technically when you cache something, you are creating a cache file which is a static html file. So if you have 1,000 users then it would create 1,000 separate cache files. This would not slow down if you have enough space on machine, as you would read in one file only per user. It is

Re: Cache Elements for Different Users

2007-07-13 Thread Humble Groups
Awesome. I was looking for a way to do that. Thanks for the input. On 7/5/07, Ketan Patel [EMAIL PROTECTED] wrote: Found a way to do it using cake without modifying the core libs. This is a workaround, but does the job. $this-element('tagCloud', array('cache'='+1 day', 'plugin'= $userId));

Re: Cache Elements for Different Users

2007-07-05 Thread Chris Hartjes
On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any scope in an enhancement to the Cake cache, that allowed you to bind certain session variables into the cache hash. Eg. you could setup the cache for certain views to be cached with an md5 of specified session variables. I

Re: Cache Elements for Different Users

2007-07-05 Thread [EMAIL PROTECTED]
Thought it could do with some discussion before going onto trac, so we could clean up any debate over it, but yeah, will get round to that soon. simon On Jul 5, 2:15 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any scope in an

Re: Cache Elements for Different Users

2007-07-05 Thread Chris Hartjes
On 7/5/07, Ketan Patel [EMAIL PROTECTED] wrote: Can some one pls shed some light here. I don't think Cake can help you out there. What you might have to do is code your element in such a way that it does the caching itself based on a unique ID. You might consider a small file-based caching

Re: Cache Elements for Different Users

2007-07-05 Thread Ketan Patel
Currently I do ?php echo $this-element('tagCloud', array('cache'='+1 day')); ? Element 'tagCloud' : ?php $this-requestAction('controller'='tag', 'action'='generateTagCloud'); ? What I would want to do is to have a cached element individual to each user? So it could be like 'tagCloud_user1',

Re: Cache Elements for Different Users

2007-07-05 Thread [EMAIL PROTECTED]
Is there any scope in an enhancement to the Cake cache, that allowed you to bind certain session variables into the cache hash. Eg. you could setup the cache for certain views to be cached with an md5 of specified session variables. It would solve this problem, and probably make quite a nice

Re: Cache Elements for Different Users

2007-07-05 Thread R. Rajesh Jeba Anbiah
On Jul 5, 6:03 pm, Ketan Patel [EMAIL PROTECTED] wrote: Currently I do ?php echo $this-element('tagCloud', array('cache'='+1 day')); ? Element 'tagCloud' : ?php $this-requestAction('controller'='tag', 'action'='generateTagCloud'); ? What I would want to do is to have a cached element

Re: Cache Elements for Different Users

2007-07-05 Thread Ketan Patel
Found a way to do it using cake without modifying the core libs. This is a workaround, but does the job. $this-element('tagCloud', array('cache'='+1 day', 'plugin'= $userId)); so this would create the file 'element_$userId_tagCloud' in the cache folder for views. Now to delete it,

Re: Cache Elements for Different Users

2007-07-05 Thread Ketan Patel
Thanks Rajesh, to get me going in right direction. Ketan R. Rajesh Jeba Anbiah wrote: On Jul 5, 6:03 pm, Ketan Patel [EMAIL PROTECTED] wrote: Currently I do ?php echo $this-element('tagCloud', array('cache'='+1 day')); ? Element 'tagCloud' : ?php

Cache Elements for Different Users

2007-07-04 Thread Ketan Patel
Is there a way to cache elements separately for each user? Currently, since the element name is same, the cache is basically overwritten, I would prefer to cache the element individually. So that later on, I can delete the cache when an update is performed for that user, otherwise it is uses the