Skip to content

staticfile caching breaks if mtimes are not available even though etags differ. #3052

@grindhold

Description

@grindhold

I have spent the day debugging into a caching problem that is already described in #2891 .

This problem might not appear so bad, because usually when you change the file, the mtime of the file changes as well. I am, however currently in an environment where the mtime of each static file is always set to unix epoch zero and i have no influence on changing that.

This leads to the following behavior:

  1. check wheter if-none-match equals etag
  2. get resulting difference, falsely leading to the if-modified-since check instead of returning false
  3. comparing if-modified-since (which in my case is unix epoch zero) which the file's mtime (which is always unix epoch zero)
  4. falsely determining that the files must be the same thus falsely returning 304

If this was implemented according to RFC7232, this would work without a problem even for my weird case.

Please consider merging #2891 . The problem is already solved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions