perf: cache pre-fetched mailboxes on the HTTP level#11293
Conversation
|
If I read the Firefox network logs correctly the requests are not cached. I have turned on HTTP caching. Other requests, mostly images, are cached.
^ header is sent, but doesn't have the expected effect |
|
It works with Chromium. It says (disk cache). |
|
Spent more time than I should and still can't figure out why Firefox is not caching XHRs despite the cache headers |
ChristophWurst
left a comment
There was a problem hiding this comment.
Works in Chromium, Firefox situation unclear, could be my setup
b5c47c0 to
1af5574
Compare
|
Nice, Thank you! I expected something different when reading "ETag". It looks more like a cache buster, and the server will not respond with 204 status. |
1af5574 to
c03980e
Compare
|
I renamed the parameter from (The member of the serialized mailbox is called Thanks @kesselb for the suggestion. |
c03980e to
0d02b07
Compare
|
I included some unit tests ... |
0d02b07 to
6cc6cca
Compare
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
6cc6cca to
0c4ac27
Compare
|
/backport to stable5.1 |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Fix #11282
Each mailbox gets assigned with an etag which is generated from its id and all three sync tokens. This etag will be included in pre-fetch requests and the server will enable caching for the response.
If a mailbox is changed in the meantime, the etag will be different, resulting in a different URL which will cause the client to refetch the cached first page.
Etags are injected via initial state.
The cache duration of a week (immutable) is up for discussion. Please keep in mind that the newest state will always be fetched once a user opens a mailbox. The pre-fetch mechanism is more about preventing a loading skeleton when first opening a mailbox.