FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Container-via-index.html: If-None-Match uses directory ETag, not index.html ETag · Issue #317 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub

Repository navigation

Container-via-index.html: If-None-Match uses directory ETag, not index.html ETag #317

Open

Description

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.

Activity

  1. added
    bugSomething isn't working
    cachingHTTP caching, ETags, Cache-Control
    on May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcachingHTTP caching, ETags, Cache-Control

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL