Commit c734f883 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Prevent stale Livewire hash after deploys — add no-cache headers for HTML responses

After each deploy, Livewire's JS hash changes. Without no-cache on HTML,
browsers serve the old page with the wrong /livewire-{hash}/update endpoint,
causing 404s until the user hard-refreshes.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 805b7d54
...@@ -34,8 +34,10 @@ server { ...@@ -34,8 +34,10 @@ server {
try_files $uri $uri/ /index.php?$query_string; try_files $uri $uri/ /index.php?$query_string;
} }
# Laravel routing # Laravel routing — no browser cache on HTML pages (prevents stale Livewire hash)
location / { location / {
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
add_header Pragma "no-cache" always;
try_files $uri $uri/ /index.php?$query_string; try_files $uri $uri/ /index.php?$query_string;
} }
......
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