Procházet zdrojové kódy

httpd: add back immutable flag for static contents

The combination of a low max-age and immutable lets the web browser
cache local content for some time.

The web browser will still cache beyond that time, and so can issue
conditional requests (304 status.)
H. Peter Anvin před 2 roky
rodič
revize
a4cbce538a
4 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      esp32/max80/httpd.c
  2. binární
      esp32/output/max80.ino.bin
  3. binární
      fpga/output/v1.fw
  4. binární
      fpga/output/v2.fw

+ 1 - 1
esp32/max80/httpd.c

@@ -655,7 +655,7 @@ static esp_err_t httpd_static_handler(httpd_req_t *req)
     len = snprintf(buffer, buffer_size-2,
 		   "HTTP/1.1 %s\r\n"
 		   "Date: %s\r\n"
-		   "Cache-Control: max-age=10\r\n"
+		   "Cache-Control: max-age=10, immutable\r\n"
 		   "ETag: %s\r\n",
 		   response,
 		   http_now(),

binární
esp32/output/max80.ino.bin


binární
fpga/output/v1.fw


binární
fpga/output/v2.fw