fix: use slowpages to cache doc/active ()

This commit is contained in:
Robert Sparks 2023-06-07 15:35:17 -05:00 committed by GitHub
parent 0c3ff8be59
commit 0864b73aab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -846,11 +846,12 @@ def index_all_drafts(request):
return render(request, 'doc/index_all_drafts.html', { "categories": categories })
def index_active_drafts(request):
slowcache = caches['slowpages']
cache_key = 'doc:index_active_drafts'
groups = cache.get(cache_key)
groups = slowcache.get(cache_key)
if not groups:
groups = active_drafts_index_by_group()
cache.set(cache_key, groups, 15*60)
slowcache.set(cache_key, groups, 15*60)
return render(request, "doc/index_active_drafts.html", { 'groups': groups })
def ajax_select2_search_docs(request, model_name, doc_type):

View file

@ -5,7 +5,7 @@
{% load cache %}
{% block title %}Active Internet-Drafts{% endblock %}
{% block content %}
{% cache 900 ietf_doc_index_active_drafts %}
{% cache 900 ietf_doc_index_active_drafts using="slowpages" %}
{% origin %}
<h1>Active Internet-Drafts</h1>
<p>