Skip to content

Commit a00cac7

Browse files
committed
🎨 Update authorization cache TTL to 30 minutes for improved performance
1 parent ee22f37 commit a00cac7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

services/web/server/src/simcore_service_webserver/security/_authz_policy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@
2727

2828
_logger = logging.getLogger(__name__)
2929

30-
# Keeps a cache during bursts to avoid stress on the database
3130
_SECOND = 1 # in seconds
32-
_AUTHZ_BURST_CACHE_TTL: Final = 5 * _SECOND
31+
_MINUTE: Final = 60 * _SECOND
32+
_AUTHZ_BURST_CACHE_TTL: Final = (
33+
# Rationale: a user's access to a product does not change that frequently
34+
# Keeps a cache during bursts to avoid stress on the database
35+
30
36+
* _MINUTE
37+
)
3338

3439

3540
@contextlib.contextmanager

0 commit comments

Comments
 (0)