mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Improve http caching in redbean
This commit is contained in:
parent
d0d9cd38c5
commit
2c7f865b12
1 changed files with 3 additions and 3 deletions
|
@ -2123,10 +2123,10 @@ static char *AppendCache(char *p, int64_t seconds) {
|
||||||
if (seconds < 0) return p;
|
if (seconds < 0) return p;
|
||||||
p = stpcpy(p, "Cache-Control: max-age=");
|
p = stpcpy(p, "Cache-Control: max-age=");
|
||||||
p = FormatUint64(p, seconds);
|
p = FormatUint64(p, seconds);
|
||||||
if (seconds) {
|
if (!seconds) {
|
||||||
p = stpcpy(p, ", public");
|
|
||||||
} else {
|
|
||||||
p = stpcpy(p, ", no-store");
|
p = stpcpy(p, ", no-store");
|
||||||
|
} else {
|
||||||
|
p = stpcpy(p, ", must-revalidate");
|
||||||
}
|
}
|
||||||
p = AppendCrlf(p);
|
p = AppendCrlf(p);
|
||||||
return AppendExpires(p, (int64_t)shared->nowish + seconds);
|
return AppendExpires(p, (int64_t)shared->nowish + seconds);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue