0

I have a database cache for my django application.

I can do the following to get multiple cache rows from the table:

cache.get_many(cache_keys_list)

This is a sequential query retrieving one record at a time:

enter image description here

Is it possible to have a queryset method for a database cache like would for any other model object to retrieve multiple values?

2
  • what version of Django you use Commented May 28, 2020 at 21:25
  • also take note that database cache is rarely helpful, never used it in production Commented May 28, 2020 at 21:34

1 Answer 1

1

It seems you are using Django version prior to release of following optimization

You could update Django , use following function as snippet or create custom MyDatabaseCache from new code

current source is here

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, just realized I was looking at the 1.11 source code and it has been updated since.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.