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
Reducing the number of queries against our data is necessary to maintain a stable product. Email Branding should be cached in local memory.
Ticket is understood, and QA has been contacted (if the ticket has a QA label).
User Story(ies)
As a VA Notify reliability dev I want to reduce unnecessary DB calls So that our db is only used when necessary
Additional Info and Resources
get_html_email_options checks service.email_branding, which appears to lazy load. That's good (we don't need to query that every time we get the service), but we also don't need to query it if we have already done it once. The service_id could potentially be used as a key. We don't have to use service.email_branding, as there is no way to cache that.
May not need a dataclass, as we likely only need a value or two which would be fine in a tuple.
User Story - Business Need
Reducing the number of queries against our data is necessary to maintain a stable product. Email Branding should be cached in local memory.
User Story(ies)
As a VA Notify reliability dev
I want to reduce unnecessary DB calls
So that our db is only used when necessary
Additional Info and Resources
get_html_email_options
checksservice.email_branding
, which appears to lazy load. That's good (we don't need to query that every time we get the service), but we also don't need to query it if we have already done it once. Theservice_id
could potentially be used as a key. We don't have to useservice.email_branding
, as there is no way to cache that.May not need a dataclass, as we likely only need a value or two which would be fine in a tuple.
Acceptance Criteria
@cached(cache=TTLCache(maxsize=1024, ttl=600))
QA Considerations
Should be no difference for end-users.
Potential Dependencies
The text was updated successfully, but these errors were encountered: