Jelajahi Sumber

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 2 tahun lalu
induk
melakukan
a4cbce538a
4 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      esp32/max80/httpd.c
  2. TEMPAT SAMPAH
      esp32/output/max80.ino.bin
  3. TEMPAT SAMPAH
      fpga/output/v1.fw
  4. TEMPAT SAMPAH
      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(),

TEMPAT SAMPAH
esp32/output/max80.ino.bin


TEMPAT SAMPAH
fpga/output/v1.fw


TEMPAT SAMPAH
fpga/output/v2.fw