summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-02-05 09:38:30 +0100
committerGravatar default2024-02-05 09:38:30 +0100
commit823cb05fe53e364c4421512a9f1263ed54662de0 (patch)
tree0268750548dd2113a8cda4f649a6fb4d3a889525
parentIn build_mentions(), avoid adding a user handle more than once. (diff)
downloadsnac2-823cb05fe53e364c4421512a9f1263ed54662de0.tar.gz
snac2-823cb05fe53e364c4421512a9f1263ed54662de0.tar.xz
snac2-823cb05fe53e364c4421512a9f1263ed54662de0.zip
Don't serve a cached admin page if it's older than the server start time.
-rw-r--r--html.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/html.c b/html.c
index fca5751..f0cda81 100644
--- a/html.c
+++ b/html.c
@@ -2379,7 +2379,13 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2379 status = 401; 2379 status = 401;
2380 } 2380 }
2381 else { 2381 else {
2382 if (cache && history_mtime(&snac, "timeline.html_") > timeline_mtime(&snac)) { 2382 double t = history_mtime(&snac, "timeline.html_");
2383
2384 /* if enabled by admin, return a cached page if its timestamp is:
2385 a) newer than the timeline timestamp
2386 b) newer than the start time of the server
2387 */
2388 if (cache && t > timeline_mtime(&snac) && t > p_state->srv_start_time) {
2383 snac_debug(&snac, 1, xs_fmt("serving cached timeline")); 2389 snac_debug(&snac, 1, xs_fmt("serving cached timeline"));
2384 2390
2385 status = history_get(&snac, "timeline.html_", body, b_size, 2391 status = history_get(&snac, "timeline.html_", body, b_size,