Skip to content

Commit

Permalink
vertigo-cli: Increased statics max-age in Cache-Control header to 1 y…
Browse files Browse the repository at this point in the history
…ear to match Google's Lighthouse recommendations
  • Loading branch information
sfisol committed Jan 31, 2025
1 parent 3b6377a commit 1b221b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

* `css` attribute in `dom!` macro now accepts `&Css` (referenced) for convenience

### Changed

* vertigo-cli: Increased statics max-age in Cache-Control header to 1 year to match Google's Lighthouse recommendations

## 0.6.1 - 2024-12-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion crates/vertigo-cli/src/serve/serve_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ async fn handler(
async fn set_cache_header<B: Send>(mut response: Response<B>) -> Response<B> {
response.headers_mut().insert(
header::CACHE_CONTROL,
HeaderValue::from_static("public, max-age=86400"),
HeaderValue::from_static("public, max-age=31536000"),
);
response
}
2 changes: 1 addition & 1 deletion demo/app/src/app/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn render(state: &app::State) -> DomNode {
Route::Sudoku => dom! { <Sudoku state={&state.sudoku} /> },
Route::Input => dom! { <MyInput value={&state.input} /> },
Route::GithubExplorer => dom! { <GitHubExplorer state={&state.github_explorer} /> },
Route::GameOfLife { .. } => dom! { <GameOfLife state={&state.game_of_life} /> },
Route::GameOfLife => dom! { <GameOfLife state={&state.game_of_life} /> },
Route::Chat => dom! { <Chat ws_chat={&state.ws_chat}/> },
Route::Todo => dom! { <Todo /> },
Route::DropFile => dom! { <DropFiles /> },
Expand Down

0 comments on commit 1b221b2

Please sign in to comment.