Steffen Nurpmeso wrote in <20220227225619.pzahj%stef...@sdaoden.eu>: |Solène wrote in | <3311e74f-1ad8-49b3-96d7-3f3c7f2af...@perso.pw>: ||27 févr. 2022 19:37:20 j...@bitminer.ca: || ||> Would it be too much to ask to defend the (poor) web master against ||> own-goal errors? ||> ||> That is, approximately: ||> ||> if ((access(gzpath, R_OK) == 0) && ||> (stat(gzpath, &gzst) == 0) && ||> (gzst->st_mtim.tv_sec >= ||> st->st_mtim.tv_sec)) { /* new test */ ||> path = gzpath; st = &gzst; kv_add(&resp->http_headers, ||> "Content-Encoding", "gzip"); ||> } ||> ||> (apologies for formatting errors) ||> ||> In english: the gz file must be the same age as or newer than the ||> original. ||> ||> My assumption being that "static" files are not always static. ||> And correctly updating .gz files requires a bit of a delete-update-recre\ ||> \ ||> ate ||> dance. | ||I'd prefer not have much logic for this so it's easier to understand \ ||for admins. This feels wrong to serve a file or another depending on \ ||their timestamp. | |Sorry for stepping into this again, but lighttpd compress uses |a special folder for this, like this ambiguities cannot happen.
(And a simple cron job can remove things which have been unused for a long time.) --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)