fix: prevent stale mastodon instance config from cache

This commit is contained in:
2026-07-08 07:21:48 +04:00
parent 9a017f5479
commit 05d01fb7bc
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -676,7 +676,7 @@ setSecurityHeaders();
<script src="js/main.js"></script> <script src="js/main.js"></script>
<script src="js/pleroma-adapter.js"></script> <script src="js/pleroma-adapter.js"></script>
<script src="js/mastodon-timeline.umd.js"></script> <script src="js/mastodon-timeline.umd.js"></script>
<script src="js/mastodon-config.php"></script> <script src="js/mastodon-config.php?v=<?php echo md5(MASTODON_INSTANCE_URL . MASTODON_DATE_FORMAT . MASTODON_BTN_SEE_MORE . MASTODON_BTN_RELOAD . MASTODON_MAX_POST_FETCH . MASTODON_MAX_POST_SHOW); ?>"></script>
<!-- PWA Service Worker --> <!-- PWA Service Worker -->
<script> <script>
+4
View File
@@ -4,6 +4,10 @@ require_once '../includes/config.php';
// Définir le type de contenu en JavaScript // Définir le type de contenu en JavaScript
header('Content-Type: application/javascript'); header('Content-Type: application/javascript');
// Empêcher la mise en cache navigateur de la configuration dynamique
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: 0');
?> ?>
window.addEventListener("load", () => { window.addEventListener("load", () => {
const mastodonTimeline = new MastodonTimeline.Init({ const mastodonTimeline = new MastodonTimeline.Init({
+3 -3
View File
@@ -1,6 +1,6 @@
const CACHE_NAME = 'fediverse-oki-16102025-1128'; const CACHE_NAME = 'fediverse-oki-08072026-0720';
const STATIC_CACHE_NAME = 'fediverse-oki-static-16102025-1128'; const STATIC_CACHE_NAME = 'fediverse-oki-static-08072026-0720';
const DYNAMIC_CACHE_NAME = 'fediverse-oki-dynamic-16102025-1128'; const DYNAMIC_CACHE_NAME = 'fediverse-oki-dynamic-08072026-0720';
// Ressources à mettre en cache immédiatement // Ressources à mettre en cache immédiatement
const STATIC_ASSETS = [ const STATIC_ASSETS = [