Index: src/cgi.c ================================================================== --- src/cgi.c +++ src/cgi.c @@ -313,11 +313,11 @@ cgi_rfc822_datestamp(etag_mtime())); } }else if( g.isConst ){ /* isConst means that the reply is guaranteed to be invariant, even ** after configuration changes and/or Fossil binary recompiles. */ - fprintf(g.httpOut, "Cache-Control: max-age=31536000\r\n"); + fprintf(g.httpOut, "Cache-Control: max-age=315360000, immutable\r\n"); }else{ fprintf(g.httpOut, "Cache-control: no-cache\r\n"); } if( blob_size(&extraHeader)>0 ){ Index: src/etag.c ================================================================== --- src/etag.c +++ src/etag.c @@ -173,10 +173,26 @@ cgi_set_status(304, "Not Modified"); cgi_reply(); db_close(0); fossil_exit(0); } + +/* +** If the output is determined purely by hash parameter and the hash +** is long enough to be invariant, then set the g.isConst flag, indicating +** that the output will never change. +*/ +void etag_check_for_invariant_name(const char *zHash){ + size_t nHash = strlen(zHash); + if( nHash7 && fossil_strcmp(&zName[nName-7], ".tar.gz")==0 ){ /* Special case: Remove the ".tar.gz" suffix. */ nName -= 7; zName[nName] = 0; Index: src/zip.c ================================================================== --- src/zip.c +++ src/zip.c @@ -940,10 +940,13 @@ nRid = strlen(zRid); zInclude = P("in"); if( zInclude ) pInclude = glob_create(zInclude); zExclude = P("ex"); if( zExclude ) pExclude = glob_create(zExclude); + if( zInclude==0 && zExclude==0 ){ + etag_check_for_invariant_name(z); + } if( eType==ARCHIVE_ZIP && nName>4 && fossil_strcmp(&zName[nName-4], ".zip")==0 ){ /* Special case: Remove the ".zip" suffix. */