I am currently working on adding memcache to an application running on GAE / J. I have a question about how production memory behaves when values โโexpire if they are also deleted.
The closest I could find to answer this question: http://code.google.com/appengine/docs/java/memcache/overview.html#How_Cached_Data_Expires
I know that I cannot rely on the values โโfound in memcache; and I donโt do it, but what interests me is that the keys that display these values โโare also deleted.
In other words, if I do
mycache.contains("key")
Will this remain true after the value is pushed out of the cache?
Side note: do not think that it matters; but just in case, I use async memcache from memcache service and grabbed onto it like this:
MemcacheServiceFactory.getAsyncMemcacheService();
I ask about it because I am not doing typical
if(cache.get("key") == null)
I keep null values โโwhen they return from the data store, so I do not constantly look at the null value. And I will take care to remove the key when it can change. Therefore, just because the memcache search returns null, I'm working on the assumption that the request is actually null; but I am sure that when other queries that may change happen that the null search is deleted. This is why I use cache.contains("key") rather than cache.get("key") == null
source share