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

Bug: cache is not updated if the file size has not changed #31

Open
Jipok opened this issue Mar 2, 2024 · 2 comments
Open

Bug: cache is not updated if the file size has not changed #31

Jipok opened this issue Mar 2, 2024 · 2 comments

Comments

@Jipok
Copy link

Jipok commented Mar 2, 2024

I'm writing PATCH support for a standard webdav server in go. While I was testing different bytes=A-B, I noticed that if the file size did not change after the operation, then the old version of the file would be displayed on the local file system. You can restart the web server, rewrite the file 100 times on the server or client (but without changing the size), wait a hour, but the client will still have the old version of the file without changes.
I also tested dufs to make sure that the problem is not in my implementation. There's a problem there too.

Perhaps I still made a mistake somewhere. But I suggest you check with your webserver too.

@Jipok
Copy link
Author

Jipok commented Mar 2, 2024

20240302_225958
While I was doing the test example, I noticed that even changing the size does not always reset the cache. As you can see, adding locally to the end of the file using echo did not clear the cache. Only size changes on the server that are not tracked by the webdavfs allow you to see the real file.

@Jipok
Copy link
Author

Jipok commented Mar 2, 2024

My implementation:
https://github.com/Jipok/webdavWithPATCH

I can’t help but say that the PATCH option proposed by SabreDav is redundant. It is not clear why it was necessary to require the range to be specified if Content-Length was available. How and what should the server do if the sizes do not match. The ability to write at an offset from the end of the file seems useless. After all, the only real application of this method is an implementation similar to webdavfs. And for this, a simple indication of the offset from the beginning of the file is enough. That's all. The append mode is actually not needed either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant