File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -547,7 +547,13 @@ async def get_domain_breach_summary(
547547 try :
548548 domain = d .lower ().strip ()
549549
550- # Initialize datastores
550+ # Check cache first
551+ cache_key = f"domain-breach-summary:{ domain } "
552+ cached_result = get_cached_breaches (cache_key )
553+ if cached_result :
554+ return DomainBreachSummaryResponse (** cached_result )
555+
556+ # Cache miss - query Datastore
551557 ds_xon = datastore .Client ()
552558
553559 # Query xon records for domain
@@ -613,6 +619,10 @@ async def get_domain_breach_summary(
613619 ]
614620 }
615621
622+ # Cache the response
623+ response_data = {"sendDomains" : breaches_dict , "SearchStatus" : "Success" }
624+ cache_breaches (cache_key , response_data )
625+
616626 return DomainBreachSummaryResponse (
617627 sendDomains = breaches_dict , SearchStatus = "Success"
618628 )
You can’t perform that action at this time.
0 commit comments