Fossil SCM

Change from using Expires: to Cache-Control: to control caching.

drh 2014-12-18 23:34 trunk
Commit c8414504e1a6a317c8a11e00c3e49227d1d4cb93
1 file changed +1 -3
+1 -3
--- src/cgi.c
+++ src/cgi.c
@@ -342,13 +342,11 @@
342342
** case of most /getfile calls for specific versions, the only way the
343343
** content changes is if someone breaks the SCM. And if that happens, a
344344
** stale cache is the least of the problem. So we provide an Expires
345345
** header set to a reasonable period (default: one week).
346346
*/
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");
350348
}else{
351349
fprintf(g.httpOut, "Cache-control: no-cache\r\n");
352350
}
353351
354352
/* Content intended for logged in users should only be cached in
355353
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button