diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index f354c7e31a..c5049d37f9 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -796,12 +796,18 @@ impl Server { header::CONTENT_SECURITY_POLICY, HeaderValue::from_static("default-src *:*/content/ *:*/blockheight *:*/blockhash *:*/blockhash/ *:*/blocktime 'unsafe-eval' 'unsafe-inline' data: blob:"), ); + + let body = inscription.into_body(); + let cache_control = match body { + Some(_) => "max-age=31536000, immutable", + None => "max-age=600", + }; headers.insert( header::CACHE_CONTROL, - HeaderValue::from_static("max-age=31536000, immutable"), + HeaderValue::from_str(cache_control).unwrap(), ); - Some((headers, inscription.into_body()?)) + Some((headers, body?)) } async fn preview(