# Custom Headers
You often need to attach headers to responses, such as cache controls, custom identifiers, or cookies.
#Modifying the Response
Use the insert_header or append_header methods on the HttpResponseBuilder.
code_blocksrust
use actix_web::{get, HttpResponse, Responder};
use actix_web::http::header;
#[get("/data")]
async fn get_data() -> impl Responder {
HttpResponse::Ok()
.insert_header((header::CACHE_CONTROL, "public, max-age=3600"))
.insert_header(("X-Custom-Identifier", "12345"))
.body("Cached data")
}#typed Headers
Actix Web leverages the http::header module for strongly typed standard header names, reducing the risk of typos compared to string literals.