Note that axum server decides how the caching is handled, if caching is CDN based or not, for example:
use axum::{
response::{Html, IntoResponse},
http::header,
};
async fn ssr_handler() -> impl IntoResponse {
let html = render_ssr_html();
(
[
(header::CACHE_CONTROL, "no-store"),
(header::PRAGMA, "no-cache"),
],
Html(html),
)
}
use tower_http::services::ServeDir;
let assets = ServeDir::new("assets")
.precompressed_gzip()
.with_cache_control("public, max-age=31536000, immutable");
Router::new().nest_service("/assets", assets);
Note that axum server decides how the caching is handled, if caching is CDN based or not, for example: