Use 6 month cache for items that don't really need to expire

This commit is contained in:
Mouse Reeve 2022-01-06 10:27:12 -08:00
parent 0f37e0ad42
commit b3bfaf0586
4 changed files with 9 additions and 4 deletions

View file

@ -2,7 +2,8 @@
{% load cache %}
{% load bookwyrm_tags %}
{% cache None suggested_books request.user.id %}
{# 6 month cache #}
{% cache 15552000 suggested_books request.user.id %}
{% suggested_books as suggested_books %}
<section class="block">
<h2 class="title is-4">{% trans "Your Books" %}</h2>

View file

@ -2,7 +2,9 @@
{% load utilities %}
{% load cache %}
{% spaceless %}
{% cache None titleby book.id %}
{# 6 month cache #}
{% cache 15552000 titleby book.id %}
{% if book.authors.exists %}
{% blocktrans trimmed with path=book.local_path title=book|book_title %}

View file

@ -1,7 +1,8 @@
{% load i18n %}
{% load cache %}
{% cache None follow_button request.user.id user.id %}
{# 6 month cache #}
{% cache 15552000 follow_button request.user.id user.id %}
{% if request.user == user or not request.user.is_authenticated %}
{% elif user in request.user.blocks.all %}
{% include 'snippets/block_button.html' with blocks=True %}

View file

@ -3,7 +3,8 @@
{% load cache %}
{% if request.user.is_authenticated %}
{% cache None shelve_button request.user.id book.id %}
{# 6 month cache #}
{% cache 15552000 shelve_button request.user.id book.id %}
{% with book.id|uuid as uuid %}
{% active_shelf book as active_shelf %}