WIP: improve performance of "is public" queries via a static cache table
The querysets radioreport_is_public
and radioreport_is_private
were
horribly slow (more than five seconds for only 2000 recordings).
These querysets are rather complicated, but are used quite frequently,
thus they justify a custom caching approach.
Now the public/private state of each recording is evaluated once per
day. All further requests are now processed quickly.
The following issues still need to be resolved:
- add a signal handler for calculating the public/private flag of new recording objects
- determine, whether the public/private flag may become stale under certain circumstances
- determine, why many records are neither part of the
radioreport_is_public
norradioreport_is_private
queryset: 1657 (public) + 12 (private) != 2193 (all records)
Please note: this commit is a bit older, thus I cannot tell, whether it is still useful. Before applying it, we should implement/decide the issues above.