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); }