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

[iOS] Stats: Caching improvements #17904

Closed
frosty opened this issue Feb 8, 2022 · 3 comments
Closed

[iOS] Stats: Caching improvements #17904

frosty opened this issue Feb 8, 2022 · 3 comments

Comments

@frosty
Copy link
Contributor

frosty commented Feb 8, 2022

When monitoring the app's network traffic using Charles Proxy, we can see that when you switch between tabs or dates in the Stats view we seem to make requests to the server every single time even if we've just fetched data for the current view.

We should improve caching and make better use of the caching we have in place to ensure that we don't continually hit the network. Each of these views has pull to refresh, so users can always manually fetch the latest data.

@frosty
Copy link
Contributor Author

frosty commented Feb 8, 2022

After walking through the code, it seems that we already have good caching in place but we can make some improvements to smooth out the user experience:

  • We currently hit the network every time we revisit the screens. Android has a TTL of 5 minutes for data in the stats screen, so we'll implement the same here. If cached data exists and it's < 5 mins since we last reloaded, we'll show the cached data. If users want newer data in that time, they can still pull to refresh.
  • In the Period screens, we ghost views on everything when we reload even if we already had cached data. Instead, we'll not show ghost loading views if we already have cached data to display.

@staskus
Copy link
Contributor

staskus commented Jan 9, 2023

I'm cleaning up issues related to Stats Revamp and Stats.

@frosty , I'm unassigning you from the task and we'll see if these suggestions are still relevant going forward.

@staskus
Copy link
Contributor

staskus commented Feb 28, 2024

When updating Traffic/Insights tabs we're looking and implementing optimization and caching on a case-by-case basis. I'm closing this issue.

@staskus staskus closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants