Bump some cache times up
authorMagnus Hagander <magnus@hagander.net>
Thu, 18 Feb 2021 16:13:38 +0000 (17:13 +0100)
committerMagnus Hagander <magnus@hagander.net>
Thu, 18 Feb 2021 16:15:25 +0000 (17:15 +0100)
About page goes from 10min to 30min (short cache to rotate the
quotes).

Search results go from 15min to 30 min.

Dynamic CSS goes from 6 hours to 48 hours, since we use cache busting
URLs everywhere these days, and on average they change very seldom.

pgweb/core/views.py
pgweb/search/views.py

index 5edcadfaaa7d4140ecfdb974d47d4a3c2d6f46f1..e9a37090fbdff00939ad47fca76d06ad88ebccf6 100644 (file)
@@ -89,7 +89,7 @@ def home(request):
 
 
 # About page view (contains information about PostgreSQL + random quotes)
-@cache(minutes=10)
+@cache(minutes=30)
 def about(request):
     # get 5 random quotes
     quotes = Quote.objects.filter(approved=True).order_by('?').all()[:5]
@@ -212,7 +212,7 @@ _dynamic_cssmap = {
 }
 
 
-@cache(hours=6)
+@cache(hours=48)
 def dynamic_css(request, css):
     if css not in _dynamic_cssmap:
         raise Http404('CSS not found')
index 5f0df75b1ebdcbc0f433e474c446d09d031bcd05..049916fd3b07506b97b21bdbb53efecd40e583c7 100644 (file)
@@ -47,7 +47,7 @@ def generate_pagelinks(pagenum, totalpages, querystring):
 
 
 @csrf_exempt
-@cache(minutes=15)
+@cache(minutes=30)
 def search(request):
     # Perform a general web search
     # Since this lives in a different database, we open a direct