Follow-up surfaced during #316 review.
Problem
In src/handlers/resource.js handleGet, for containers that have an index.html (including the conneg path that extracts a JSON-LD data-island from it and returns Turtle/JSON-LD), the If-None-Match / 304 check runs earlier against the directory's ETag (stats.etag, derived from directory mtime/size). But the response body for these variants comes from index.html, and the response ETag is indexStats.etag.
Result: a client revalidating with the ETag we actually returned (the index.html one) will always mismatch the directory ETag — the 304 fast-path is missed and the server returns a full 200. Efficiency bug.
Severity
Efficiency, not correctness. Body is still correct; just more bandwidth than necessary. Matters more now that must-revalidate (from #316) causes clients to revalidate on every use.
Suggested fix
Move the If-None-Match check to after the effective ETag is chosen for the selected variant — use indexStats.etag for index.html-backed representations, stats.etag for directory-listing representations.
Follow-up surfaced during #316 review.
Problem
In
src/handlers/resource.jshandleGet, for containers that have anindex.html(including the conneg path that extracts a JSON-LD data-island from it and returns Turtle/JSON-LD), theIf-None-Match/ 304 check runs earlier against the directory's ETag (stats.etag, derived from directory mtime/size). But the response body for these variants comes fromindex.html, and the responseETagisindexStats.etag.Result: a client revalidating with the ETag we actually returned (the index.html one) will always mismatch the directory ETag — the 304 fast-path is missed and the server returns a full 200. Efficiency bug.
Severity
Efficiency, not correctness. Body is still correct; just more bandwidth than necessary. Matters more now that
must-revalidate(from #316) causes clients to revalidate on every use.Suggested fix
Move the
If-None-Matchcheck to after the effective ETag is chosen for the selected variant — useindexStats.etagfor index.html-backed representations,stats.etagfor directory-listing representations.