Improve http caching in redbean

This commit is contained in:
Justine Tunney 2022-06-17 02:44:03 -07:00
parent d0d9cd38c5
commit 2c7f865b12

View file

@ -2123,10 +2123,10 @@ static char *AppendCache(char *p, int64_t seconds) {
if (seconds < 0) return p;
p = stpcpy(p, "Cache-Control: max-age=");
p = FormatUint64(p, seconds);
if (seconds) {
p = stpcpy(p, ", public");
} else {
if (!seconds) {
p = stpcpy(p, ", no-store");
} else {
p = stpcpy(p, ", must-revalidate");
}
p = AppendCrlf(p);
return AppendExpires(p, (int64_t)shared->nowish + seconds);