1👍
There is be a better way than flushing the entire cache. See cache versioning:
When you change running code that uses cached values, you may need to
purge any existing cached values. The easiest way to do this is to
flush the entire cache, but this can lead to the loss of cache values
that are still valid and useful.Django provides a better way to target individual cache values.
Django’s cache framework has a system-wide version identifier,
specified using the VERSION cache setting. The value of this setting
is automatically combined with the cache prefix and the user-provided
cache key to obtain the final cache key.
Source:stackexchange.com