Sunday, February 28, 2010

RE: Add to Cached data?

What I did was after the save read the array and for each push it back into
an array and add the newly saved data to the array and over-write the
original cache with original data plus the new record.

That worked best. But is there a way to actually just count the cache
records, add 1 to the count and simply insert the new set of data into the
original rather than looping thru it?

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of John Andersen
Sent: February-28-10 6:44 AM
To: CakePHP
Subject: Re: Add to Cached data?

You should be able to read the cached data back, make you changes, and save
it in the cache again!
But it will not have been saved in the database, as you are not going
through the model!
Thus on the final change to the cached data, you will have to save the data
to your model, if you want it to persist longer than in just the current
session (correct me if I am wrong here!!).
Enjoy,
John

On Feb 28, 11:42 am, "Dave" <make.cake.b...@gmail.com> wrote:
> Is it possible to add to cached data for a user?
>
> User has a list of saved  "ads" for people selling / buying stuff
> classifieds type set up...then they bookmark a new "ad" can you add
> that data to the current cached data? Or you have to delete all and
> query all data again and save it?
>
> They can click "my ads" to view all the ones they saved but rather
> than running a query each time figure you could keep adding to the
> cache after each save rather than having to query ads they have saved over
and over.
>
> 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+unsubscribe@googlegroups.com For more options, visit this group
cake-php+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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: