Hi

yes, I agree on this too; but I also trust on Dave decition. I think that if
he took the time to check the session filesize he is smart enough to note
this obvious manner too; and I think that if he asks about storing this in
sessions is because in some way it's important to have that information
quickly.

I mean that if the favorites is not very very important, I would use the DB
approach too instead of working in a session. But he asked this for some
reason that we don't know and because of that we can only reply his question
instead of giving a more detailed solution.

What I would do, if the info is important enough, is to:

a (and necessary) - put the info in DB in a table as JBloutus suggests,
indexing both fields.
b-Put that information in memcache instead of Sessions.
c-Use Cake caching engine as default, without Memcache.

Best!



On Thu, Sep 23, 2010 at 11:06 PM, j.blotus <[email protected]> wrote:

> Why not just create a new table to store the favorites?
>
> UserFavorites
> id
> user_id
> post_id
>
> seems like it would be better than using a session
>
> On Sep 23, 5:13 pm, "Dave Maharaj" <[email protected]> wrote:
> > I have my Users who save favourite Posts
> >
> > At login I get all the saved Posts id's and save then to the users
> session,
> > when they save new one it adds it's ID to the list, delete removes the ID
> > from the session. Now this list can get rather long as you can imagine
> say
> > roughly 200 saved favourite id's.
> >
> > Now rather than Session I have the option of CACHE to do the same thing.
> > Cache the users fav's on login, add / delete to the cached list.
> >
> > Session seems best since its created and deleted on login / logout but is
> > there a performance difference from the 2 that anyone knows of? I made a
> > dummy files with 1000 id's and the file size was 7k so its still rather a
> > small amount of data. So sticking with the session seems best but would
> like
> > to hear what others think.
> >
> > Any feedback would be great.
> >
> > Thanks.
> >
> > Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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