update caching on homepage, and add db checks to healthcheck

This commit is contained in:
badblocks 2025-04-29 12:17:23 -07:00
parent 411c274e56
commit 7d94dc001f
4 changed files with 75 additions and 18 deletions

View file

@ -41,44 +41,44 @@
<h2 id="stats-heading" class="text-2xl font-semibold mb-4">Card Stats</h2>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
<!-- Most Offered Cards -->
{% cache CACHE_TIMEOUT most_offered_cards cache_key_most_offered_cards %}
<div>
<div class="card card-border bg-base-100 shadow-lg">
<div class="card-header text-base-content p-4">
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Most Offered</h5>
</div>
<div class="card-body my-4 p-0">
{% cache 300 most_offered_cards %}
{% include "home/_card_list.html" with cards=most_offered_cards %}
{% endcache %}
{% include "home/_card_list.html" with cards=most_offered_cards %}
</div>
</div>
</div>
{% endcache %}
<!-- Most Wanted Cards -->
{% cache CACHE_TIMEOUT most_wanted_cards cache_key_most_wanted_cards %}
<div>
<div class="card card-border bg-base-100 shadow-lg">
<div class="card-header text-base-content p-4">
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Most Wanted</h5>
</div>
<div class="card-body my-4 p-0">
{% cache 300 most_wanted_cards %}
{% include "home/_card_list.html" with cards=most_wanted_cards %}
{% endcache %}
{% include "home/_card_list.html" with cards=most_wanted_cards %}
</div>
</div>
</div>
{% endcache %}
<!-- Least Offered Cards (Last Group) -->
{% cache CACHE_TIMEOUT least_offered_cards cache_key_least_offered_cards %}
<div class="col-span-2 md:col-span-1">
<div class="card card-border bg-base-100 shadow-lg">
<div class="card-header text-base-content p-4">
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Least Offered</h5>
</div>
<div class="card-body my-4 p-0">
{% cache 300 least_offered_cards %}
{% include "home/_card_list.html" with cards=least_offered_cards %}
{% endcache %}
{% include "home/_card_list.html" with cards=least_offered_cards %}
</div>
</div>
</div>
{% endcache %}
</div>
</section>
@ -86,6 +86,7 @@
<section class="mb-8">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Featured Offers -->
{% cache CACHE_TIMEOUT featured_offers cache_key_featured_offers %}
<div>
<div class="p-4 text-center ">
<h5 class="text-xl font-semibold whitespace-nowrap truncate mb-0">Featured Offers</h5>
@ -102,8 +103,9 @@
{% endif %}
</div>
</div>
{% endcache %}
<!-- Recent Offers -->
{% cache CACHE_TIMEOUT recent_offers cache_key_recent_offers %}
<div>
<div class="text-center p-4">
<h5 class="text-xl font-semibold whitespace-nowrap truncate mb-0">Recent Offers</h5>
@ -118,6 +120,7 @@
</div>
</div>
</div>
{% endcache %}
</div>
</section>
{% endblock content %}