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

Videos UI: Better cache handling. #59576

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

andres-blanco
Copy link
Contributor

This PR derives from a discussion on how to handle caching/refetching.

This uses two react query options: refetchOnReconnect and refetchOnWindowFocus. The intended result is that a refetch is triggered every time the VideoUI component is loaded but DO NOT refetch on window focus.

Testing

  1. Apply this patch.
  2. Open the Video UI from the card.
  3. Verify that the query is executed.
  4. Change tabs and verify that when you come back the query is not executed again.
  5. Verify that after closing and reopening the popup the query is re-executed.

@andres-blanco andres-blanco self-assigned this Dec 27, 2021
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 27, 2021
@github-actions
Copy link

@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~4 bytes added 📈 [gzipped])

name  parsed_size           gzip_size
home        +21 B  (+0.0%)       +4 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@andres-blanco andres-blanco merged commit 3d8084a into trunk Jan 3, 2022
@andres-blanco andres-blanco deleted the feature/videos-ui-better-fetching branch January 3, 2022 14:55
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants