Add cache header when serving a static file. Thanks to Vincent Bernardoff for sending a patch.

v0.9.0
Jeroen Domburg 10 years ago
parent 65a409dd23
commit bc6f84771e
  1. 1
      user/httpdespfs.c

@ -47,6 +47,7 @@ int ICACHE_FLASH_ATTR cgiEspFsHook(HttpdConnData *connData) {
connData->cgiData=file; connData->cgiData=file;
httpdStartResponse(connData, 200); httpdStartResponse(connData, 200);
httpdHeader(connData, "Content-Type", httpdGetMimetype(connData->url)); httpdHeader(connData, "Content-Type", httpdGetMimetype(connData->url));
httpdHeader(connData, "Cache-Control", "max-age=3600, must-revalidate");
httpdEndHeaders(connData); httpdEndHeaders(connData);
return HTTPD_CGI_MORE; return HTTPD_CGI_MORE;
} }

Loading…
Cancel
Save