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 advisable to cache elements only if you are gaining
significant savings in SQL queries and computational time. If you have
single SQL query, then probably its not the best idea to cache element
as it would not add much overhead. Its all about performance
optimization.

I have written a cake article for caching elements individually for
each user but it is pending approval. The url is
http://bakery.cakephp.org/articles/view/cache-elements-individually-for-each-user

Hope I answered your questions,

Ketan


On Jul 13, 3:37 pm, inVINCable <[EMAIL PROTECTED]> wrote:
> 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', 
> array('cache'=>'+1 day', 'user_id'=>$userid)...
>
> would that work for setting up a cached element for each user? And
> have you noticed if having possibly thousands of cached elements, one
> for each user, has caused a noticable slowdown? Please reply because I
> am contemplating on doing the same thing you have suggested. Thank
> you.
> On Jul 5, 8:45 am, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> > Thanks Rajesh, to get me going in right direction.Ketan
>
> > R. Rajesh Jeba Anbiah wrote:
>
> > > On Jul 5, 6:03 pm,KetanPatel<[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 individual to each
> > > > user? So it could be like 'tagCloud_user1', 'tagCloud_user2',... & so
> > > > on. but I could n't find anything in the code that really does that?
> > >    <snip>
>
> > >    What about passing params?
>
> > >   $this->element('tagCloud', array('cache'=>'+1 day', 'user_id'=>10)
>
> > > --
> > >   <?php echo 'Just another PHP saint'; ?>
> > > Email: rrjanbiah-at-Y!com    Blog:http://rajeshanbiah.blogspot.com/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to