Reputation: 11467
Is NDB query() going through the cache?
NDB docs mention that it will use the cache automatically. Is this only for get_by_id or also for query statements like e.g.:
Product.query().order(Product.name).fetch()
In many pages I’m displaying a Product list that’s why I want it to come from the cache.
Alternative way would be to query the Product list and store in memcache myself, but in this case Product updates will not end up in my ‘manual’ cache. Or would it be an option to store all Product id’s in the cache myself and retrieve them then via memcache/datastore. But this would require a get_by_id which accepts multiple id’s and returns a list..
Upvotes: 5
Views: 1515