Fossil

Check-in [c8414504e1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change from using Expires: to Cache-Control: to control caching.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c8414504e1a6a317c8a11e00c3e49227d1d4cb93
User & Date: drh 2014-12-18 23:34:45.052
Context
2014-12-19
12:51
Fix a compiler warning in markdown.c that occurs only with -Os on gcc. ... (check-in: 623057ea59 user: drh tags: trunk)
2014-12-18
23:34
Change from using Expires: to Cache-Control: to control caching. ... (check-in: c8414504e1 user: drh tags: trunk)
22:27
fixed the mtime field on json timeline output. ... (check-in: df50cb6e4d user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/cgi.c.
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
    ** else. In the case of attachments, the contents won't change because
    ** an attempt to change them generates a new attachment number. In the
    ** case of most /getfile calls for specific versions, the only way the
    ** content changes is if someone breaks the SCM. And if that happens, a
    ** stale cache is the least of the problem. So we provide an Expires
    ** header set to a reasonable period (default: one week).
    */
    /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
    time_t expires = time(0) + 604800;
    fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires));
  }else{
    fprintf(g.httpOut, "Cache-control: no-cache\r\n");
  }

  /* Content intended for logged in users should only be cached in
  ** the browser, not some shared location.
  */







<
<
|







340
341
342
343
344
345
346


347
348
349
350
351
352
353
354
    ** else. In the case of attachments, the contents won't change because
    ** an attempt to change them generates a new attachment number. In the
    ** case of most /getfile calls for specific versions, the only way the
    ** content changes is if someone breaks the SCM. And if that happens, a
    ** stale cache is the least of the problem. So we provide an Expires
    ** header set to a reasonable period (default: one week).
    */


    fprintf(g.httpOut, "Cache-control: max-age=28800\r\n");
  }else{
    fprintf(g.httpOut, "Cache-control: no-cache\r\n");
  }

  /* Content intended for logged in users should only be cached in
  ** the browser, not some shared location.
  */