Cache the JSON in Redis

The endpoints are probably fast enough, but it seems risky to have a
public URL which causes a new query every time the page is loaded.
This commit is contained in:
Chris Hill-Scott
2021-03-11 10:53:12 +00:00
parent 25a6788d66
commit 545f933e37
2 changed files with 68 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
from app.notify_client import NotifyAdminAPIClient
from app.notify_client import NotifyAdminAPIClient, cache
class PerformanceDashboardAPIClient(NotifyAdminAPIClient):
@cache.set('performance-stats-{start_date}-to-{end_date}')
def get_performance_dashboard_stats(
self,
*,