Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of Head response cache #1155

Conversation

ArnyminerZ
Copy link
Member

Purpose

Right now, the ETag of a WebDAV file is stored in cache, when already been opened by Android. The issue is that this is enforced, so if the file is modified on the server, the cached ETag is used, which doesn't match the correct one, so the request fails with 412.

See #1150 for more info.

Short description

Got rid of HeadResponseCache, so the HEAD request is always made upon opening a WebDAV file.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

Signed-off-by: Arnau Mora Gras <[email protected]>
@ArnyminerZ ArnyminerZ added refactoring Internal improvement of existing functions webdav related to WebDAV file access labels Dec 5, 2024
@ArnyminerZ ArnyminerZ self-assigned this Dec 5, 2024
@ArnyminerZ ArnyminerZ linked an issue Dec 5, 2024 that may be closed by this pull request
2 tasks
@rfc2822 rfc2822 marked this pull request as ready for review December 6, 2024 10:34
Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good :) Originally I added the cache because some apps (like the gallery) open the same files several times in parallel and I wanted to avoid repetitive HEAD requests … but it's not safe. So it's better to remove the cache.

@rfc2822 rfc2822 merged commit 239038a into main-ose Dec 6, 2024
8 checks passed
@rfc2822 rfc2822 deleted the 1150-webdav-etag-cache-is-not-invalidated-by-412-response-to-get-w-if-match branch December 6, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions webdav related to WebDAV file access
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WebDAV] ETag cache is not invalidated by 412 response to GET w/ If-Match
2 participants