Skip to content

Commit

Permalink
Extended cache for js and css
Browse files Browse the repository at this point in the history
  • Loading branch information
gskjold committed Jan 31, 2023
1 parent 6c9a8b0 commit b7d2823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/SvelteUi/include/AmsWebHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ static const char HEADER_LOCATION[] PROGMEM = "Location";

static const char CACHE_CONTROL_NO_CACHE[] PROGMEM = "no-cache, no-store, must-revalidate";
static const char CACHE_1HR[] PROGMEM = "public, max-age=3600";
static const char CACHE_1MO[] PROGMEM = "public, max-age=2592000";
static const char PRAGMA_NO_CACHE[] PROGMEM = "no-cache";
static const char EXPIRES_OFF[] PROGMEM = "-1";
static const char AUTHENTICATE_BASIC[] PROGMEM = "Basic realm=\"Secure Area\"";
Expand Down
4 changes: 2 additions & 2 deletions lib/SvelteUi/src/AmsWebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ void AmsWebServer::indexCss() {
if(!checkSecurity(2))
return;

server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1HR);
server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1MO);
server.setContentLength(INDEX_CSS_LEN);
server.send_P(200, MIME_CSS, INDEX_CSS);
}
Expand All @@ -744,7 +744,7 @@ void AmsWebServer::indexJs() {
if(!checkSecurity(2))
return;

server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1HR);
server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1MO);
server.setContentLength(INDEX_JS_LEN);
server.send_P(200, MIME_JS, INDEX_JS);
}
Expand Down

0 comments on commit b7d2823

Please sign in to comment.