You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cache_response decorator is used to apply cache to view sets. Usually, attempts to fetch cached data is a "nice to have" to any view call in terms of performance. Therefore, any error on cache should not fail the view call. Instead, a more resilient approach is to ignore cache on errors, and proceed to usual view call.
Issue
When an error occurs on cache layer, it is propagated to the application layer without giving the chance for upstream code to catch it and proceed with whatever approach it wants to - be that log the error, raise a new exception or simply run the view action normally without cache.
Suggestions
Add the behavior for cache_response to proceed with view action call when cache call fails;
Add the option to call a handler when a cache error occur.
The text was updated successfully, but these errors were encountered:
ottusp
added a commit
to ottusp/drf-toolkit
that referenced
this issue
Jul 27, 2024
When cache fails, exceptions were not captured, so the whole view call would fail.
Since a cache hit attempt is an optional feature (it just saves performance), ignoring cache on cache errors is a more resilient approach.
Closesflamingo-run#59
ottusp
added a commit
to ottusp/drf-toolkit
that referenced
this issue
Jul 27, 2024
When cache fails, exceptions were not captured, so the whole view call would fail.
Since a cache hit attempt is an optional feature (it just saves performance), ignoring cache on cache errors is a more resilient approach.
Closesflamingo-run#59
Context
@cache_response
decorator is used to apply cache to view sets. Usually, attempts to fetch cached data is a "nice to have" to any view call in terms of performance. Therefore, any error on cache should not fail the view call. Instead, a more resilient approach is to ignore cache on errors, and proceed to usual view call.Issue
When an error occurs on cache layer, it is propagated to the application layer without giving the chance for upstream code to catch it and proceed with whatever approach it wants to - be that log the error, raise a new exception or simply run the view action normally without cache.
Suggestions
cache_response
to proceed with view action call when cache call fails;The text was updated successfully, but these errors were encountered: