Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SmartEVSE-3/packfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# now gzip the stuff except zones.csv since this file is not served by mongoose but directly accessed:
for file in os.listdir("data"):
filename = os.fsdecode(file)
if filename == "cert.pem" or filename == "key.pem" or filename == "CH32V203.bin" or filename == "SmartEVSE.webp":
if filename == "cert.pem" or filename == "key.pem" or filename == "CH32V203.bin" or filename.endswith(".webp") or filename.endswith(".avif"):
shutil.copy('data/' + filename, 'pack.tmp/data/' + filename)
filelist.append('data/' + filename)
continue
Expand Down
1 change: 1 addition & 0 deletions SmartEVSE-3/src/mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,7 @@ static struct mg_str s_known_types[] = {
MG_C_STR("tgz"), MG_C_STR("application/tar-gz"),
MG_C_STR("wav"), MG_C_STR("audio/wav"),
MG_C_STR("webp"), MG_C_STR("image/webp"),
MG_C_STR("avif"), MG_C_STR("image/avif"),
MG_C_STR("zip"), MG_C_STR("application/zip"),
MG_C_STR("3gp"), MG_C_STR("video/3gpp"),
{0, 0},
Expand Down
1 change: 1 addition & 0 deletions SmartEVSE-3/src/network_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ static void fn_http_server(struct mg_connection *c, int ev, void *ev_data) {
} else { // if everything else fails, serve static page
// Cache ".webp" or ".ico" image files for one year without revalidation or server checks.
if (mg_match(hm->uri, mg_str("#.webp"), NULL) ||
mg_match(hm->uri, mg_str("#.avif"), NULL) ||
mg_match(hm->uri, mg_str("#.ico"), NULL)) {
struct mg_http_serve_opts opts = {
.root_dir = "/data", .ssi_pattern = NULL,
Expand Down