diff options
author | default <nobody@localhost> | 2024-02-05 09:38:30 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2024-02-05 09:38:30 +0100 |
commit | 823cb05fe53e364c4421512a9f1263ed54662de0 (patch) | |
tree | 0268750548dd2113a8cda4f649a6fb4d3a889525 /html.c | |
parent | 74ce67a6316639974d01462a24df3fbdf9c99ae9 (diff) |
Don't serve a cached admin page if it's older than the server start time.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2379,7 +2379,13 @@ int html_get_handler(const xs_dict *req, const char *q_path, status = 401; } else { - if (cache && history_mtime(&snac, "timeline.html_") > timeline_mtime(&snac)) { + double t = history_mtime(&snac, "timeline.html_"); + + /* if enabled by admin, return a cached page if its timestamp is: + a) newer than the timeline timestamp + b) newer than the start time of the server + */ + if (cache && t > timeline_mtime(&snac) && t > p_state->srv_start_time) { snac_debug(&snac, 1, xs_fmt("serving cached timeline")); status = history_get(&snac, "timeline.html_", body, b_size, |