mirror of
https://github.com/postgres/pgweb.git
synced 2025-07-25 16:02:27 +00:00
Bump some cache times up
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.
This commit is contained in:
@ -89,7 +89,7 @@ def home(request):
|
|||||||
|
|
||||||
|
|
||||||
# About page view (contains information about PostgreSQL + random quotes)
|
# About page view (contains information about PostgreSQL + random quotes)
|
||||||
@cache(minutes=10)
|
@cache(minutes=30)
|
||||||
def about(request):
|
def about(request):
|
||||||
# get 5 random quotes
|
# get 5 random quotes
|
||||||
quotes = Quote.objects.filter(approved=True).order_by('?').all()[:5]
|
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):
|
def dynamic_css(request, css):
|
||||||
if css not in _dynamic_cssmap:
|
if css not in _dynamic_cssmap:
|
||||||
raise Http404('CSS not found')
|
raise Http404('CSS not found')
|
||||||
|
@ -47,7 +47,7 @@ def generate_pagelinks(pagenum, totalpages, querystring):
|
|||||||
|
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
@cache(minutes=15)
|
@cache(minutes=30)
|
||||||
def search(request):
|
def search(request):
|
||||||
# Perform a general web search
|
# Perform a general web search
|
||||||
# Since this lives in a different database, we open a direct
|
# Since this lives in a different database, we open a direct
|
||||||
|
Reference in New Issue
Block a user