Use cache

This commit is contained in:
Mouse Reeve
2022-01-08 11:43:56 -08:00
parent bb4b724b1a
commit 26928252cd
5 changed files with 68 additions and 50 deletions

View File

@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% load humanize %}
{% load cache %}
{% with status_type=status.status_type %}
<div
@ -15,6 +16,7 @@
<div class="columns is-gapless">
{% if not hide_book %}
{% cache 259200 content_status_book status.id %}
{% with book=status.book|default:status.mention_books.first %}
{% if book %}
<div class="column is-cover">
@ -34,6 +36,7 @@
</div>
{% endif %}
{% endwith %}
{% endcache %}
{% endif %}
<article class="column ml-3-tablet my-3-mobile">

View File

@ -3,8 +3,10 @@
{% load bookwyrm_tags %}
{% load markdown %}
{% load i18n %}
{% load cache %}
{% if not hide_book %}
{% cache 259200 generated_status_book status.id %}
{% with book=status.book|default:status.mention_books.first %}
<div class="columns is-mobile is-gapless">
<a class="column is-cover is-narrow" href="{{ book.local_path }}">
@ -24,6 +26,7 @@
</div>
</div>
{% endwith %}
{% endcache %}
{% endif %}
{% endspaceless %}