8000 Delegate cache control from Flutter to browser by tddang-linagora · Pull Request #3289 · linagora/tmail-flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Delegate cache control from Flutter to browser #3289

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

Merged
merged 5 commits into from
Nov 28, 2024
Merged

Conversation

tddang-linagora
Copy link
Collaborator
@tddang-linagora tddang-linagora commented Nov 20, 2024

Using flutter_service_worker

Screenshot 2024-11-25 at 11 57 47
  • The source is service worker, Flutter control the cache mechanism, without any way of controlling how to re-validate cache and update resources on time.

Using browser cache

Screenshot 2024-11-25 at 11 57 08
  • The source is server if 200, cached if 304 (and sometimes 200 when status code is greyed out). Browser and server (in this case, nginx) control the cache mechanism. Lifetime and cache validation is checked and executed every time the web is loaded.

@chibenwa
Copy link
Member
chibenwa commented Nov 22, 2024

Super nice.

@hoangdat @tddang-linagora when might we get it?

Is it safe to use? What is the impact?

How does it relate to #3263 ?

@tddang-linagora
Copy link
Collaborator Author
tddang-linagora commented Nov 25, 2024

Is it safe to use?

Yes

What is the impact?

  • User will see the decrease in loading speed of our app, as most if not all of those resources will be loaded from cache
  • Every time we update any resource (icon, css, js, etc.), it will be update on the client side as resources are now checked with the server every time our web app loads

How does it relate to #3263?

  • TF-3256 Update index.html cache config #3263 correct the error we implemented on the flutter_service_worker, so that the resources will be loaded from the cache instead of pulling it from the server every time our web app is loaded
  • However, due to the fact that flutter_service_worker cannot be modified/adjust according to our needs, all the resources will be cached and without a way of updating them on demand, making that the only way user can see the new changes is hard reload the web page (shift reload)
  • This PR completely remove the flutter_service_worker from our app, taking the cache from Flutter specifically to the browser to handle itself

@tddang-linagora tddang-linagora marked this pull request as ready for review November 25, 2024 08:57
@tddang-linagora tddang-linagora changed the title [WIP] Delegate cache control from Flutter to browser Delegate cache control from Flutter to browser Nov 25, 2024
@hoangdat hoangdat merged commit 9c3954a into master Nov 28, 2024
21 checks passed
hoangdat pushed a commit that referenced this pull request Jan 5, 2025
hoangdat pushed a commit that referenced this pull request Jan 6, 2025
hoangdat pushed a commit that referenced this pull request Feb 5, 2025
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

Successfully merging this pull request may close these issues.

4 participants
0