Cache hashed assets forever in fullstack (#3928)

* Cache hashed assets forever in fullstack

* fix clippy

* fix fullstack test port

* fix fullstack clippy

* fix double insertion of meta in fullstack test

* pull out head element changes

* Fix cli-optimization test when interrupted

* remove tests for raw assets

* fix playwright tests

* look for hash in asset name instead of building a manifest

* undo changes to cli

* fix clippy

* fix test_file_name_looks_immutable
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-06-19 22:18:55 -07:00
1 parent 09d8e3aef2
commit 76ffcabd0b
10 files changed
+165 -40

No files matched your search

@@ -50,6 +50,7 @@ fn app() -> Element {
OnMounted {}
DefaultServerFnCodec {}
DocumentElements {}
Assets {}
WebSockets {}
}
}
@@ -165,6 +166,24 @@ fn DocumentElements() -> Element {
}
}
/// Make sure assets in the assets folder are served correctly and hashed assets are cached forever
#[component]
fn Assets() -> Element {
rsx! {
img {
src: asset!("/assets/image.png"),
}
// TODO: raw assets support was removed and needs to be restored
// https://github.com/DioxusLabs/dioxus/issues/4115
// img {
// src: "/assets/image.png",
// }
// img {
// src: "/assets/nested/image.png",
// }
}
}
#[server(protocol = Websocket<JsonEncoding, JsonEncoding>)]
async fn echo_ws(
input: BoxedStream<String, ServerFnError>,