Added caching for the /doc/active page.
- Legacy-Id: 18625
This commit is contained in:
parent
101e8e22c2
commit
1832976b94
|
@ -544,8 +544,11 @@ def index_all_drafts(request):
|
||||||
return render(request, 'doc/index_all_drafts.html', { "categories": categories })
|
return render(request, 'doc/index_all_drafts.html', { "categories": categories })
|
||||||
|
|
||||||
def index_active_drafts(request):
|
def index_active_drafts(request):
|
||||||
groups = active_drafts_index_by_group()
|
cache_key = 'doc:index_active_drafts'
|
||||||
|
groups = cache.get(cache_key)
|
||||||
|
if not groups:
|
||||||
|
groups = active_drafts_index_by_group()
|
||||||
|
cache.set(cache_key, groups, 15*60)
|
||||||
return render(request, "doc/index_active_drafts.html", { 'groups': groups })
|
return render(request, "doc/index_active_drafts.html", { 'groups': groups })
|
||||||
|
|
||||||
def ajax_select2_search_docs(request, model_name, doc_type):
|
def ajax_select2_search_docs(request, model_name, doc_type):
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
{# Copyright The IETF Trust 2015, All Rights Reserved #}
|
{# Copyright The IETF Trust 2015, All Rights Reserved #}
|
||||||
{% load origin %}
|
{% load origin %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load cache %}
|
||||||
{% block title %}Active Internet-Drafts{% endblock %}
|
{% block title %}Active Internet-Drafts{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% cache 900 ietf_doc_index_active_drafts %}
|
||||||
{% origin %}
|
{% origin %}
|
||||||
<h1>Active Internet-Drafts</h1>
|
<h1>Active Internet-Drafts</h1>
|
||||||
|
|
||||||
|
@ -35,5 +37,5 @@
|
||||||
</p>
|
</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endcache %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue