From 8bfa4450230d6a00f836bd27944c34cd7fe43e08 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 19 Nov 2025 17:03:32 -0300 Subject: [PATCH] chore(localhost): disable caching (#3112) * chore(localhost): disable caching mostly seeing this cache being a problem on CEF - the response is cached so app updates are not reflected properly * fmt --- .changes/disable-localhost-plugin-caching.md | 5 +++++ plugins/localhost/src/lib.rs | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changes/disable-localhost-plugin-caching.md diff --git a/.changes/disable-localhost-plugin-caching.md b/.changes/disable-localhost-plugin-caching.md new file mode 100644 index 000000000..f33a8d1f1 --- /dev/null +++ b/.changes/disable-localhost-plugin-caching.md @@ -0,0 +1,5 @@ +--- +"localhost": patch +--- + +Disable caching on responses. diff --git a/plugins/localhost/src/lib.rs b/plugins/localhost/src/lib.rs index 5b00087fa..5d948b015 100644 --- a/plugins/localhost/src/lib.rs +++ b/plugins/localhost/src/lib.rs @@ -105,6 +105,10 @@ impl Builder { .insert("Content-Security-Policy".into(), csp); } + response + .headers + .insert("Cache-Control".into(), "no-cache".into()); + if let Some(on_request) = &on_request { on_request(&request, &mut response); }