[wp-hackers] Confusion About WordPress Cache

肖晗 xiaohan2012 at gmail.com
Fri Dec 17 14:42:16 UTC 2010


I am using WordPress Cache to cache data retrieved from database, using
WP_Cache <http://codex.wordpress.org/Function_Reference/WP_Cache>.

After I  used wp_cache_set to set some data in the cache, I try to get it by
wp_cache_get in ANOTHER post request.

However, it failed to retrieve the data I have previously saved.

It is ok if I try to retrieve the data in just one request(place the *set*and
*get * in the same script). *However, in separate *
*
*
*requests, I doesn't work.*

I wonder if I got the wrong idea of what *cache* is. I have it in mind that
*cache *can be preserved even in different requests

from the same user.*Then the cache has nothing different with a variable, I
think!!*

And I am doubting my idea now!

Can anyone help? Or it is not what I am thinking. *Is there any way to
retrieve the same data which has been saved *
*
*
*before(not using database) in separate requests? *


Really thanks for any response!

Best regards!

Xiaohan


More information about the wp-hackers mailing list