diff --git a/bui-demo/frontend_js/js/main.js b/bui-demo/frontend_js/js/main.js index 117f626..57af8ba 100644 --- a/bui-demo/frontend_js/js/main.js +++ b/bui-demo/frontend_js/js/main.js @@ -36,6 +36,7 @@ function send_message(msg) { var httpRequest = new XMLHttpRequest(); httpRequest.open('POST', 'callback'); httpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + httpRequest.setRequestHeader('Cache-Control', 'no-cache, no-store, max-age=0'); httpRequest.send(buf); } diff --git a/bui-demo/frontend_seed/Cargo.toml b/bui-demo/frontend_seed/Cargo.toml index 63808e0..08a2c63 100644 --- a/bui-demo/frontend_seed/Cargo.toml +++ b/bui-demo/frontend_seed/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] seed = "0.10.0" wasm-bindgen = "0.2.83" wasm-bindgen-futures = "0.4" -web-sys = {version="0.3", features=["console", "EventSource", "MessageEvent"]} +web-sys = {version="0.3", features=["console", "EventSource", "MessageEvent", "RequestCache",]} serde = "1.0.85" serde_json = "1.0.39" bui-demo-data = {path="../bui-demo-data"} diff --git a/bui-demo/frontend_seed/src/lib.rs b/bui-demo/frontend_seed/src/lib.rs index 4fa89d4..77c2bf8 100644 --- a/bui-demo/frontend_seed/src/lib.rs +++ b/bui-demo/frontend_seed/src/lib.rs @@ -114,6 +114,7 @@ async fn send_message(msg: Callback) -> Msg { use web_sys::{Request, RequestInit, Response}; let mut opts = RequestInit::new(); opts.method("POST"); + opts.cache(web_sys::RequestCache::NoStore); let buf = serde_json::to_string(&msg).unwrap(); opts.body(Some(&JsValue::from_str(&buf))); diff --git a/bui-demo/frontend_yew/Cargo.toml b/bui-demo/frontend_yew/Cargo.toml index 1bff308..90f38c0 100644 --- a/bui-demo/frontend_yew/Cargo.toml +++ b/bui-demo/frontend_yew/Cargo.toml @@ -29,6 +29,7 @@ features=[ "HtmlInputElement", "MessageEvent", "Request", + "RequestCache", "RequestInit", "RequestMode", "Response", diff --git a/bui-demo/frontend_yew/src/lib.rs b/bui-demo/frontend_yew/src/lib.rs index 490606d..9be8796 100644 --- a/bui-demo/frontend_yew/src/lib.rs +++ b/bui-demo/frontend_yew/src/lib.rs @@ -198,6 +198,7 @@ async fn post_callback(msg: Callback) -> Result<(), FetchError> { use web_sys::{Request, RequestInit, Response}; let mut opts = RequestInit::new(); opts.method("POST"); + opts.cache(web_sys::RequestCache::NoStore); // opts.mode(web_sys::RequestMode::Cors); // opts.headers("Content-Type", "application/json;charset=UTF-8") // set SameOrigin