浏览代码

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 年之前
父节点
当前提交
a4cbce538a
共有 4 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      esp32/max80/httpd.c
  2. 二进制
      esp32/output/max80.ino.bin
  3. 二进制
      fpga/output/v1.fw
  4. 二进制
      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(),

二进制
esp32/output/max80.ino.bin


二进制
fpga/output/v1.fw


二进制
fpga/output/v2.fw