Skip to content

Commit

Permalink
Cache insights views (#3095)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathjazz authored Feb 12, 2024
1 parent 2606255 commit 7bdcacc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion pontoon/insights/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
from django.urls import path
from django.views.decorators.cache import cache_page

from pontoon.settings import VIEW_CACHE_TIMEOUT

from . import views

urlpatterns = [
# Insights page
path("insights/", views.insights, name="pontoon.insights"),
path(
"insights/",
cache_page(VIEW_CACHE_TIMEOUT)(views.insights),
name="pontoon.insights",
),
]
2 changes: 1 addition & 1 deletion pontoon/localizations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# Project insights
path(
"insights/",
views.ajax_insights,
cache_page(VIEW_CACHE_TIMEOUT)(views.ajax_insights),
name="pontoon.localizations.ajax.insights",
),
]
Expand Down
2 changes: 1 addition & 1 deletion pontoon/projects/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
# Project insights
path(
"insights/",
views.ajax_insights,
cache_page(VIEW_CACHE_TIMEOUT)(views.ajax_insights),
name="pontoon.projects.ajax.insights",
),
# Project info
Expand Down
2 changes: 1 addition & 1 deletion pontoon/teams/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
# Team insights
path(
"insights/",
views.ajax_insights,
cache_page(VIEW_CACHE_TIMEOUT)(views.ajax_insights),
name="pontoon.teams.ajax.insights",
),
# Team info
Expand Down

0 comments on commit 7bdcacc

Please sign in to comment.