mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Don't serve a cached admin page if it's older than the server start time.
This commit is contained in:
parent
74ce67a631
commit
823cb05fe5
1 changed files with 7 additions and 1 deletions
8
html.c
8
html.c
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue