Fossil SCM
Change from using Expires: to Cache-Control: to control caching.
Commit
c8414504e1a6a317c8a11e00c3e49227d1d4cb93
Parent
df50cb6e4d5674e…
1 file changed
+1
-3
+1
-3
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -342,13 +342,11 @@ | ||
| 342 | 342 | ** case of most /getfile calls for specific versions, the only way the |
| 343 | 343 | ** content changes is if someone breaks the SCM. And if that happens, a |
| 344 | 344 | ** stale cache is the least of the problem. So we provide an Expires |
| 345 | 345 | ** header set to a reasonable period (default: one week). |
| 346 | 346 | */ |
| 347 | - /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/ | |
| 348 | - time_t expires = time(0) + 604800; | |
| 349 | - fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires)); | |
| 347 | + fprintf(g.httpOut, "Cache-control: max-age=28800\r\n"); | |
| 350 | 348 | }else{ |
| 351 | 349 | fprintf(g.httpOut, "Cache-control: no-cache\r\n"); |
| 352 | 350 | } |
| 353 | 351 | |
| 354 | 352 | /* Content intended for logged in users should only be cached in |
| 355 | 353 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -342,13 +342,11 @@ | |
| 342 | ** case of most /getfile calls for specific versions, the only way the |
| 343 | ** content changes is if someone breaks the SCM. And if that happens, a |
| 344 | ** stale cache is the least of the problem. So we provide an Expires |
| 345 | ** header set to a reasonable period (default: one week). |
| 346 | */ |
| 347 | /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/ |
| 348 | time_t expires = time(0) + 604800; |
| 349 | fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires)); |
| 350 | }else{ |
| 351 | fprintf(g.httpOut, "Cache-control: no-cache\r\n"); |
| 352 | } |
| 353 | |
| 354 | /* Content intended for logged in users should only be cached in |
| 355 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -342,13 +342,11 @@ | |
| 342 | ** case of most /getfile calls for specific versions, the only way the |
| 343 | ** content changes is if someone breaks the SCM. And if that happens, a |
| 344 | ** stale cache is the least of the problem. So we provide an Expires |
| 345 | ** header set to a reasonable period (default: one week). |
| 346 | */ |
| 347 | fprintf(g.httpOut, "Cache-control: max-age=28800\r\n"); |
| 348 | }else{ |
| 349 | fprintf(g.httpOut, "Cache-control: no-cache\r\n"); |
| 350 | } |
| 351 | |
| 352 | /* Content intended for logged in users should only be cached in |
| 353 |