They are in a table...hence the " At login I get all the saved Posts id's
and save then to the users session,"....

Easier to read the session data to see if it’s a saved posts rather then hit
the db on every page view for view user to check if it’s a saved post 

-----Original Message-----
From: j.blotus [mailto:j.blo...@gmail.com] 
Sent: September-23-10 11:37 PM
To: CakePHP
Subject: Re: Public Opinion Needed

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" <m...@davemaharaj.com> 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to