[Answered ]-Remove or expire cache from Django queryset

1👍

According to the Django docs:

In a newly created QuerySet, the cache is empty.

Thus, just begin using a new Queryset when you want to break the cache.

👤jamjar

1👍

According to Django docs you can call .all() on the QuerySet:

When a QuerySet is evaluated, it typically caches its results. If the data in the database might have changed since a QuerySet was evaluated, you can get updated results for the same query by calling all() on a previously evaluated QuerySet.

Leave a comment