Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because the timeout value for the ZGW caching is taken from the Django settings, it is not unthinkable that, due to some misconfiguration, the timeout value could end up being None. If this is passed as-is to the low-level Django caching backend, it will be interpreted as "cache forever", because the default kwarg of 60 would be overridden. This can lead to unexpected behavior, e.g. ZGW API objects appearing to be stale because the cache never expires.
This commit makes this process more explicit by setting a default only if no timeout kwarg is provided, and also interpreting a timeout of "None" as a request for the default timeout, to fully prohibit "cache forever" scenarios.