feat: add cache header
This commit is contained in:
parent
b297785dd5
commit
d7421324dc
1 changed files with 3 additions and 1 deletions
|
@ -39,9 +39,11 @@ fn send_response(mut stream: TcpStream, status: u16, body: Body) -> UnitOrBoxedE
|
||||||
_ => "500 INTERNAL SERVER ERROR",
|
_ => "500 INTERNAL SERVER ERROR",
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut response = format!("HTTP/1.1 {}\r\nServer: luciders/0.1.0\r\n", status_line);
|
let mut response = format!("HTTP/1.1 {}\r\n", status_line);
|
||||||
|
|
||||||
// Headers
|
// Headers
|
||||||
|
response.push_str("Server: luciders/0.1.0\r\n");
|
||||||
|
response.push_str("Cache-Control: immutable, public, max-age=604800\r\n");
|
||||||
response.push_str(&format!(
|
response.push_str(&format!(
|
||||||
"Content-Length: {}\r\n",
|
"Content-Length: {}\r\n",
|
||||||
match &body {
|
match &body {
|
||||||
|
|
Loading…
Reference in a new issue