With further testing, I noticed that the If-Modified-Since cache control
mechanism does not seem to work for /uv web pages, anymore. This can be
seen by repeatedly downloading the Fossil Source Tarball using wget:

wget -N http://www.fossil-scm.org/index.html/uv/fossil-src-2.6.tar.gz
...

For unmodified downloads, wget is expected to say:

HTTP request sent, awaiting response... 304 Not Modified
File 'fossil-src-2.6.tar.gz' not modified on server. Omitting download.

But for the Fossil Source Tarball, it repeatedly says:

HTTP request sent, awaiting response... 200 OK
Server ignored If-Modified-Since header for file 'fossil-src-2.6.tar.gz'.

I know that this feature used to work well, when it was added, I can still
remember my joy :) about it:

[...] If-Modified-Since [...] works like a charm! [0]

[0]
https://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg27068.html

I noticed a few things:

Both etag_check() and etag_last_modified() in src/etag.c properly call
fossil_exit() to shutdown SQLite when they handle a cache hit (they are
called from doc_page() in src/doc.c).

But they are called inside a db_step() { ... } db_finalize() block [1], and
when they call fossil_exit(), db_finalize() does not seem to be called.
(When fossil_exit() calls db_close(), there's some db_finalize() action
going on, but if I understand that right, it's just for the local checkout
database, and not for the main repository database.) I'm not sure if this
might be the reason for the leftover SHM and WAL files?

[1] http://fossil-scm.org/index.html/artifact?name=dbf23864f8&ln=648-652

I'm also not 100% sure why wget can't handle the If-Modified-Since case any
more, as the initial requests to /uv web pages correctly return both ETag
and Last-Modified headers. But, after updating the Fossil binary to version
2.6, I suspect that wget may hit the following condition: [2]

[2] http://fossil-scm.org/index.html/artifact?name=535a623ccd&ln=154-157

This looks like unversioned files older than the Fossil binary always
generate If-Modified-Since cache misses (since the Last-Modified header
always seems to report the "real" mtime, and not a "Fossil binary"-adjusted
"pseudo mtime", as is done for ETags computation).

Therefore, I would like to make the following suggestions:

* Check if db_finalize() should be called explicitly before etag_check()
and etag_last_modified() are allowed to terminate Fossil.

* Check if the "resources older than the Fossil binary always get
If-Modified-Since cache misses" condition should be relaxed for /uv web
pages (this condition may make sense for CSS style sheets compiled into the
Fossil binary, for example).

* cgi_modified_since() in src/cgi.c seems to be unused [3].

[3] http://fossil-scm.org/index.html/artifact?name=da970218b4&ln=1957-1970

--Florian
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to