mirror of
https://github.com/wled/WLED.git
synced 2025-12-03 06:37:43 +00:00
Compare commits
8 Commits
copilot/im
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db71cf3289 | ||
|
|
714a7f816c | ||
|
|
0adfc17617 | ||
|
|
54f650a0e9 | ||
|
|
441bd62ad6 | ||
|
|
2dfe09e1b5 | ||
|
|
c9ac77a2b7 | ||
|
|
9fcdfd976a |
@@ -38,6 +38,11 @@ const wledBanner = `
|
|||||||
\t\t\x1b[36m build script for web UI
|
\t\t\x1b[36m build script for web UI
|
||||||
\x1b[0m`;
|
\x1b[0m`;
|
||||||
|
|
||||||
|
// Generate build timestamp as UNIX timestamp (seconds since epoch)
|
||||||
|
function generateBuildTime() {
|
||||||
|
return Math.floor(Date.now() / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
const singleHeader = `/*
|
const singleHeader = `/*
|
||||||
* Binary array for the Web UI.
|
* Binary array for the Web UI.
|
||||||
* gzip is used for smaller size and improved speeds.
|
* gzip is used for smaller size and improved speeds.
|
||||||
@@ -46,6 +51,9 @@ const singleHeader = `/*
|
|||||||
* to find out how to easily modify the web UI source!
|
* to find out how to easily modify the web UI source!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Automatically generated build time for cache busting (UNIX timestamp)
|
||||||
|
#define WEB_BUILD_TIME ${generateBuildTime()}
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const multiHeader = `/*
|
const multiHeader = `/*
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ static bool inLocalSubnet(const IPAddress &client) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void generateEtag(char *etag, uint16_t eTagSuffix) {
|
static void generateEtag(char *etag, uint16_t eTagSuffix) {
|
||||||
sprintf_P(etag, PSTR("%7d-%02x-%04x"), VERSION, cacheInvalidate, eTagSuffix);
|
sprintf_P(etag, PSTR("%u-%02x-%04x"), WEB_BUILD_TIME, cacheInvalidate, eTagSuffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setStaticContentCacheHeaders(AsyncWebServerResponse *response, int code, uint16_t eTagSuffix = 0) {
|
static void setStaticContentCacheHeaders(AsyncWebServerResponse *response, int code, uint16_t eTagSuffix = 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user