Skip to content

Commit

Permalink
feat: Strongly cache Copilot files (#19766)
Browse files Browse the repository at this point in the history
Speeds up every reload as there is no need to check if the files have changed
  • Loading branch information
Artur- authored Aug 15, 2024
1 parent 21cd2fb commit 8631c7d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,11 @@ public boolean serveDevModeRequest(HttpServletRequest request,
}
});

if (requestFilename
.startsWith("/VAADIN/generated/jar-resources/copilot/")) {
// Cache copilot files as they have a generated hash at the end
response.setHeader("Cache-Control", "max-age=31536001,immutable");
}
if (responseCode == HttpURLConnection.HTTP_OK) {
// Copies response payload
writeStream(response.getOutputStream(),
Expand Down

0 comments on commit 8631c7d

Please sign in to comment.