commit 823cb05
default
·
2024-02-05 08:38:30 +0000 UTC
parent 74ce67a
Don't serve a cached admin page if it's older than the server start time.
1 files changed,
+7,
-1
M
html.c
M
html.c
+7,
-1
1@@ -2379,7 +2379,13 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2 status = 401;
3 }
4 else {
5- if (cache && history_mtime(&snac, "timeline.html_") > timeline_mtime(&snac)) {
6+ double t = history_mtime(&snac, "timeline.html_");
7+
8+ /* if enabled by admin, return a cached page if its timestamp is:
9+ a) newer than the timeline timestamp
10+ b) newer than the start time of the server
11+ */
12+ if (cache && t > timeline_mtime(&snac) && t > p_state->srv_start_time) {
13 snac_debug(&snac, 1, xs_fmt("serving cached timeline"));
14
15 status = history_get(&snac, "timeline.html_", body, b_size,