MySQL Forums
Forum List  »  memcached

need help while using mecahced keys
Posted by: veera narayana
Date: August 24, 2009 12:16AM

Hi All,

I am newbie to memcached. Currently i am working on PHP and i installed memcached on my system. I tired and succeed while create cache using set and get methods.

But i am confusing while assigning keys. Here is my requirement.

1) If user1 comes and fetch results from a table, fetched results are stored in cache using some key(say 'countryinfo')

then user2 comes and wants to fetch the same result from the database. Then how do we know the cache is already existed with the name 'countryinfo'.

I don't want to give the key name as static. I want it to be dynamic , coz i am running hundrads of queries in my project. It much complicate to maintain static keys for each query.

2) I am fetching different data from the same table using different where conditions. for example

SELECT * FROM tbl_users WHERE user_id = 40

SELECT username,gender FROM tbl_users WHERE user_id = 50

In this case, How do i maintain cache

Thanks in advance

Options: ReplyQuote

Written By
need help while using mecahced keys
August 24, 2009 12:16AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.