diff --git a/apps/desktop/src-tauri/src/http_server.rs b/apps/desktop/src-tauri/src/http_server.rs index e640bde..40204d2 100644 --- a/apps/desktop/src-tauri/src/http_server.rs +++ b/apps/desktop/src-tauri/src/http_server.rs @@ -250,7 +250,23 @@ async fn spa_fallback(uri: Uri) -> Response { .first_or_octet_stream() .as_ref() .to_string(); - ([(header::CONTENT_TYPE, mime)], asset.data.into_owned()).into_response() + let cache = if served.starts_with("assets/") { + // Vite content-hashes everything under assets/ — cacheable forever. + "public, max-age=31536000, immutable" + } else { + // index.html + unhashed public files (maps, fonts, manifest): always + // revalidate, so a self-updated exe serves its fresh frontend instead + // of a browser-cached copy of the previous version. + "no-cache" + }; + ( + [ + (header::CONTENT_TYPE, mime), + (header::CACHE_CONTROL, cache.to_string()), + ], + asset.data.into_owned(), + ) + .into_response() } #[cfg(debug_assertions)] diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index fd9588c..c7909ec 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -22,7 +22,8 @@ "fullscreen": false, "alwaysOnTop": false, "transparent": true, - "shadow": false + "shadow": false, + "additionalBrowserArgs": "--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection --disable-http-cache" } ], "security": {