1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-21 17:00:00 +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:
Nicolas F 2019-03-08 15:29:51 +01:00 committed by Arylide
parent 585e1aeae7
commit 6a63ee241a

View file

@ -93,6 +93,7 @@
</div>
</div>
{% cache 86400, "filelist", torrent.info_hash_as_hex %}
{% if files and files.__len__() <= config.MAX_FILES_VIEW %}
<div class="panel panel-default">
<div class="panel-heading">
@ -133,6 +134,7 @@
</div>
</div>
{% endif %}
{% endcache %}
<div id="comments" class="panel panel-default">
<div class="panel-heading">