From a5ccc1166a24d36a3fa1208164efc72fdb838a4b Mon Sep 17 00:00:00 2001 From: dj-oyu <68707227+dj-oyu@users.noreply.github.com> Date: Sun, 22 Feb 2026 21:34:33 +0900 Subject: [PATCH] fix: disable browser caching on dev proxy responses CSS/JS changes were not reflected through the proxy because the browser/ WebView cached them. Set Cache-Control: no-cache, no-store, must-revalidate and strip ETag/Last-Modified on all dev proxy responses. Co-Authored-By: Claude Opus 4.6 --- pkg/miniapp/miniapp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/miniapp/miniapp.go b/pkg/miniapp/miniapp.go index 4f4c9538a..e7b3b2437 100644 --- a/pkg/miniapp/miniapp.go +++ b/pkg/miniapp/miniapp.go @@ -280,6 +280,11 @@ func (h *Handler) ActivateDevTarget(id string) error { proxy := httputil.NewSingleHostReverseProxy(u) proxy.ModifyResponse = func(resp *http.Response) error { + // Prevent browser/WebView from caching dev proxy responses (CSS, JS, etc.) + resp.Header.Set("Cache-Control", "no-cache, no-store, must-revalidate") + resp.Header.Del("ETag") + resp.Header.Del("Last-Modified") + ct := resp.Header.Get("Content-Type") if !strings.Contains(ct, "text/html") { return nil