guardian / guardian/dotcom-rendering
Avoid Revalidate on Focus for Results
Open
- Dominant language
- TypeScript
- Stars
- 274
- Forks
- 34
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 121
Description
By default SWR revalidates on focus so every time user comes back to the page, swr refetches data. But this is inefficient for when the match has finished. Lets explore if we can find a way to fix this with one of the following approaches or a better one if you can find out:
- Disable the `Revalidate on Focus` but test how this affects on mobile browsers for live matches. In mobile when user is out of focus, the javascript is suspended, and when user is back in focus, javascript is back to running.
- Is there a way to change this setting based on the fetched data
Contributor guide
Assessment
This issue has not been assessed yet.