Issue
I am working on a datastore project on which I have to work with memcache
. But because I never used memcache
before so I am confused with it. I followed this link and successfully saved and retrieved values from memcache.
$memcache = new Memcache;
$value = $request->getContent();
return $memcache->set($key, $value);
and
$memcache = new Memcache;
return $memcache->get($key);
So this is enough for me when I want to only get a user's detail and save it into the memcache
. But the problem is with inserting the values from memcache
to database. Can anyone please guide me how should I approach it. Whether I should save the user's edits into the memcache
when he makes them and when try to logout then I should first save all the changes into the datastore or there are some other solutions available to make changes later? Please help me.
Solution
Don't think of it as "inserting data from memcache to the database" - there is nothing specially for this. You're just inserting into the database (in the usual way) data which just happened to be retrieved from memcache.
Answered By - Dan Cornilescu Answer Checked By - Katrina (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.