You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set real "Last-Modified" header based on file's LastWrite time
Get file's LastWrite timestamp for file handlers (if supported by FS driver)
and construct proper "Last-Modified" header. Works fine for LittleFS.
If not supported by FS than fallback to previous implementation with manual value for "Last-Modified".
Signed-off-by: Emil Muratov <[email protected]>
It is possible to specify Date-Modified header to enable the server to return Not-Modified (304) response for requests
880
-
with "If-Modified-Since" header with the same value, instead of responding with the actual file content.
879
+
Sever sets "Last-Modified" header automatically if FS driver supports file modification timestamps (LittleFS does).
880
+
Server returns "Not-Modified" (304) response for requests with "If-Modified-Since" header with _the same_ value as file's mod date, instead of responding with the actual file content. It does not perform date calculations checking if File's mod date is newer or later than in "If-Modified-Since" header.
881
+
882
+
For FS not supporting file timestamps (like deprecated SPIFFS) it is possible to specify Date-Modified header manually.
883
+
881
884
```cpp
882
885
// Update the date modified string every time files are updated
883
886
server.serveStatic("/", SPIFFS, "/www/").setLastModified("Mon, 20 Jun 2016 14:00:00 GMT");
0 commit comments