add some no-cache headers

This commit is contained in:
Peter Cai 2020-04-08 21:12:58 +08:00
parent cd8f761fcf
commit fe22944cb4
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
2 changed files with 4 additions and 2 deletions

View File

@ -81,7 +81,8 @@ async fn default_route(_req: Request, url: Url) -> MyResult<Response> {
ResponseInit::new()
.status(200)
.headers(headers!{
"Content-Type" => "text/html"
"Content-Type" => "text/html",
"Cache-Control" => "no-cache"
}.as_ref())
).internal_err();
}

View File

@ -79,7 +79,8 @@ async fn get_actions(_req: Request, url: Url) -> MyResult<Response> {
ResponseInit::new()
.status(200)
.headers(headers!{
"Content-Type" => "application/json"
"Content-Type" => "application/json",
"Cache-Control" => "no-cache"
}.add_cors().as_ref())
).internal_err()
}