experiment with cache (again)

This commit is contained in:
proddy
2024-06-25 10:42:05 +02:00
parent 4ebd0657f4
commit 2184fbb113

View File

@@ -39,6 +39,7 @@ ESP8266React::ESP8266React(AsyncWebServer * server, FS * fs)
response->addHeader("Content-Encoding", "gzip");
// response->addHeader("Content-Encoding", "br"); // only works over HTTPS
// response->addHeader("Cache-Control", "public, immutable, max-age=31536000");
response->addHeader("Cache-Control", "must-revalidate"); // ensure that a client will check the server for a change
response->addHeader("Last-Modified", last_modified);
response->addHeader("ETag", hash);
@@ -46,6 +47,7 @@ ESP8266React::ESP8266React(AsyncWebServer * server, FS * fs)
};
server->on(uri, HTTP_GET, requestHandler);
// Serving non matching get requests with "/index.html"
// OPTIONS get a straight up 200 response
if (strncmp(uri, "/index.html", 11) == 0) {