mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 09:30:01 +00:00
templates: cache torrent view filelist (#542)
* templates: cache torrent view filelist Using flask-caching, we can add a 1 hour cache to the template output of a filelist, varying it by the key "filelist" + the hex infohash of a torrent. Using a very big filelist as a test, I get a difference in page load speeds of about a magnitude. (400ms -> 37 ms) * templates: increase filelist cache to 24 hours
This commit is contained in:
parent
585e1aeae7
commit
6a63ee241a
|
@ -93,6 +93,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% cache 86400, "filelist", torrent.info_hash_as_hex %}
|
||||||
{% if files and files.__len__() <= config.MAX_FILES_VIEW %}
|
{% if files and files.__len__() <= config.MAX_FILES_VIEW %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endcache %}
|
||||||
|
|
||||||
<div id="comments" class="panel panel-default">
|
<div id="comments" class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
|
|
Loading…
Reference in a new issue