Extended cache for js and css

This commit is contained in:
Gunnar Skjold 2023-01-31 17:16:18 +01:00
parent 6c9a8b0692
commit b7d28238ab
2 changed files with 3 additions and 2 deletions

View File

@ -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\"";

View File

@ -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);
}
@ -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);
}