{% extends "admin/base_site.html" %} {% load i18n %} {% comment %} The admin's API cache screen (karni.admin.cache.ApiCacheScreen): how response caching is set up, the flush schedule, every routed resource, and the buttons that clear everything or one resource. Override this template, or subclass ApiCacheScreen and set template_name. {% endcomment %} {% block title %}{{ title }} | {{ site_title|default:"Django site admin" }}{% endblock %} {% block extrastyle %}{{ block.super }} {% include "karni_admin/includes/page_styles.html" %} {% endblock %} {% block content %}
| {% translate "Caching" %} | {% if enabled %} {% blocktranslate trimmed with ttl=default_ttl %} On (KARNI_API_CACHE). Responses live {{ ttl }} seconds unless a viewset sets its own ttl. {% endblocktranslate %} {% else %} {% translate "Off (KARNI_API_CACHE is False): nothing is cached." %} {% endif %} |
|---|---|
| {% translate "Backend" %} | {{ backend|default:"-" }} (CACHES["{{ alias }}"]) |
| {% translate "Clearing" %} | {% if clearing == "delete_pattern" %} {% translate "The backend has delete_pattern: a clear deletes the entries." %} {% else %} {% translate "The backend has no delete_pattern: a clear replaces the version tokens, and the old entries expire by their TTL." %} {% endif %} |
| {% translate "Scheduled flush" %} | {% if flush %} {{ flush }} (KARNI_API_CACHE_FLUSH){% if not flush_active %} {% translate "not scheduled while caching is off" %}{% endif %} {% else %} {% translate "None (KARNI_API_CACHE_FLUSH is not set)." %} {% endif %} |
| {% translate "Resource" %} | {% translate "Model" %} | {% translate "TTL" %} | {% translate "Reads" %} | |
|---|---|---|---|---|
| {{ resource.route }} {{ resource.viewset }} | {{ resource.model }} | {% if resource.cached %}{{ resource.ttl }}s{% endif %} {{ resource.note }} | {{ resource.reads|join:", " }} | {% if resource.cached %} {% endif %} |
| {% translate "No resource is routed." %} | ||||