-
Notifications
You must be signed in to change notification settings - Fork 276
perf: cache pre-fetched mailboxes on the HTTP level #11293
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
6cc6cca
to
0c4ac27
Compare
/backport to stable5.1 |
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.