Commit 4073a3f3 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: disable browser caching for JS/CSS files

Cache-Control no-store headers + version query strings to bust
existing cached files on user devices.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 55a27180
......@@ -17,6 +17,15 @@ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
# Prevent caching of JS/CSS files
<IfModule mod_headers.c>
<FilesMatch "\.(js|css)$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
</IfModule>
# Security headers
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
......
......@@ -13,8 +13,9 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/public/css/tokens.css">
<link rel="stylesheet" href="/public/css/core.css">
<?php $v = '2'; ?>
<link rel="stylesheet" href="/public/css/tokens.css?v=<?=$v?>">
<link rel="stylesheet" href="/public/css/core.css?v=<?=$v?>">
</head>
<body>
<div id="game">
......@@ -24,7 +25,7 @@
<div id="overlay"></div>
<div id="toast-container"></div>
<script src="/public/js/lib/chess.min.js"></script>
<script type="module" src="/public/js/engine.js"></script>
<script src="/public/js/lib/chess.min.js?v=<?=$v?>"></script>
<script type="module" src="/public/js/engine.js?v=<?=$v?>"></script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment