forked from yubox-node-org/ESPAsyncWebServer
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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". an example code to serve static files from LittleFS with IMS revalidation ``` // serve all static files from LittleFS root / server.serveStatic("/", LittleFS, "/") .setDefaultFile("index.html") .setCacheControl("must-revalidate"); // revalidate based on etag/IMS headers ``` Signed-off-by: Emil Muratov <[email protected]>
- Loading branch information
Showing
2 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters