Implement back-end strategy to prevent caching

By setting the response header "Cache-Control" to "no-store" and setting "Expires" to 0, we make sure the browsers and place calling this never store it in cache.
This commit is contained in:
Christophe Gagnier 2023-11-08 23:46:31 -05:00
parent 51dfa9a247
commit e67a210e95

View File

@ -539,7 +539,12 @@ void serveSettingsJS(AsyncWebServerRequest* request)
strcat_P(buf,PSTR("function GetV(){var d=document;"));
getSettingsJS(subPage, buf+strlen(buf)); // this may overflow by 35bytes!!!
strcat_P(buf,PSTR("}"));
request->send(200, "application/javascript", buf);
AsyncWebServerResponse *response;
response = request->beginResponse(200, "application/javascript", buf);
response->addHeader(F("Cache-Control"),"no-store");
response->addHeader(F("Expires"),"0");
request->send(response);
}