Skip to content

Commit

Permalink
fix: cache wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Jun 21, 2024
1 parent f626a36 commit 53eeef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/windmill-api/src/static_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn serve_path(path: &str) -> Response<Body> {
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 {
if mime.as_ref() == mime::APPLICATION_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");
Expand Down

0 comments on commit 53eeef0

Please sign in to comment.