I am using GAE for my server where I have all my entities in Datastore. One of the entity has more than 2000 records, and it is taking almost 30 secs to read whole entity. So I wanted to use cache to improve performance.
I have tried Datastore objectify @cache annotation, but not finding how to read from the stored cache. I have declared entity as below:
@Entity @Cache public class Devices{ }Second thing I tried is memcache. I am storing whole List s in key, but this is not storing, I couldn't see in console memcache, but at the same time not showing any errors or exceptions while storing objects.
putvalue("temp", List<Devices>) public void putValue(String key, Object value) { Cache cache = getCache(); logger.info(TAG + "getCache() :: storing memcache for key : " + key); try { if (cache != null) { cache.put(key, value); } }catch (Exception e) { logger.info(TAG + "getCache() :: exception : " + e); } }When I tried to retrieve using
getValue("temp"), it is returning null or empty.Object object = cache.get(key);
My main object is to limit the time to 5secs to get all the records of entity. Can anyone suggest what I am doing wrong here? Or any better solution to retrieve the records fast from Datastore.