From 9bfd52529a25c993caeddbd6631e85ff2075194f Mon Sep 17 00:00:00 2001 From: Jej Date: Wed, 21 Jun 2017 12:36:15 +0200 Subject: [PATCH] Cache-Control header value needs = separator (not : ) (#180) As specified here https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 the separator for Cache-Control header values is = --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e13dc38..31d4751 100644 --- a/README.md +++ b/README.md @@ -578,15 +578,15 @@ It is possible to specify Cache-Control header value to reduce the number of cal the files. For more information on Cache-Control values see [Cache-Control](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) ```cpp // Cache responses for 10 minutes (600 seconds) -server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age:600"); +server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age=600"); //*** Change Cache-Control after server setup *** // During setup - keep a pointer to the handler -AsyncStaticWebHandler* handler = &server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age:600"); +AsyncStaticWebHandler* handler = &server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age=600"); // At a later event - change Cache-Control -handler->setCacheControl("max-age:30"); +handler->setCacheControl("max-age=30"); ``` ### Specifying Date-Modified header