diff --git a/backend/windmill-api/src/static_assets.rs b/backend/windmill-api/src/static_assets.rs index aa9870907e..783732b1c0 100644 --- a/backend/windmill-api/src/static_assets.rs +++ b/backend/windmill-api/src/static_assets.rs @@ -48,7 +48,10 @@ fn serve_path(path: &str) -> Response { let mut res = Response::builder() .header(header::CONTENT_TYPE, mime.as_ref()) .header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*"); - if mime.as_ref() == mime::APPLICATION_JAVASCRIPT || path.ends_with(".wasm") { + if mime.as_ref() == mime::APPLICATION_JAVASCRIPT + || mime.as_ref() == mime::TEXT_JAVASCRIPT + || path.ends_with(".wasm") + { res = res.header(header::CACHE_CONTROL, "max-age=31536000"); } else if (mime.type_(), mime.subtype()) == (mime::TEXT, mime::CSS) { res = res.header(header::CACHE_CONTROL, "max-age=31536000");