Increase provider lookup cache TTL to 10 seconds

Tested locally with TTL values of:
- 2 seconds
- 5 seconds
- 10 seconds

The benefit really started showing at 10 seconds, where >50% of lookups
hit the cache rather than the database.

For graphs see https://github.com/alphagov/notifications-api/pull/3075#issuecomment-750836404
This commit is contained in:
Chris Hill-Scott
2020-12-31 09:36:55 +00:00
parent 51b7192750
commit 55afc9a401

View File

@@ -148,7 +148,7 @@ def update_notification_to_sending(notification, provider):
dao_update_notification(notification)
provider_cache = TTLCache(maxsize=8, ttl=2)
provider_cache = TTLCache(maxsize=8, ttl=10)
@cached(cache=provider_cache)