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

Request heavy app - high amount of fetches #10416

Open
exezbcz opened this issue Jun 6, 2024 · 3 comments
Open

Request heavy app - high amount of fetches #10416

exezbcz opened this issue Jun 6, 2024 · 3 comments
Assignees
Labels
🧹 - clean-up A-explorer p1 preventing everyone from using app

Comments

@exezbcz
Copy link
Member

exezbcz commented Jun 6, 2024

@vikiival will comment on the most frontend-heavy features

Insane amount of fetches

I am not able to find the original issues but I have tried to load kodadot.xyz on uncached windows 10 PC (24 GB Ram, 8 core) with gigabit internet and this is what happened:

single-load

Single page load toook 6 min and 30 sec to finish.

That took 800 MB of data!
and more than 3000! Reqests

Therefore would be optimal to find the source of this data overfetching :) as:
more request == more compute == higher load -> slow app

Insane amount of requests / computation

is fetching a big chunk of data to process therefore if user clicks there the app will freeze

Therefore data optimization -> a.k.a do graphql resolvers is a way to go.

Originally posted by @vikiival in #10370 (comment)

@exezbcz
Copy link
Member Author

exezbcz commented Jun 6, 2024

cc @hassnian

@exezbcz exezbcz added 🧹 - clean-up A-explorer p1 preventing everyone from using app labels Jun 6, 2024
@hassnian hassnian assigned hassnian and unassigned hassnian Jun 7, 2024
@exezbcz
Copy link
Member Author

exezbcz commented Jun 7, 2024

Single page load toook 6 min and 30 sec to finish.

That took 800 MB of data! and more than 3000! Reqests

oohh, I think this is from service workers. from this plugin: https://github.com/kodadot/nft-gallery/blob/main/plugins/pwa.client.ts. let's remove then?

SW will prefetch (non-blocking request) other assets in the background and put them in the cache, so the finish looks like it took longer to complete. Here is the page without cache and bypasses the service workers.

Screenshot 2024-06-06 at 22 50 51

But we can still improve the number of requests.

  • change the 301 status to render it directly. Currently, if the content is an image, it will redirect from image-workers to cf-images. It can reduce the requests by about 50 on that page
  • Most of the requests are coming from the client's JS. Reducing the number of JS requests on the client can significantly improve the page load. But it's not an easy one. We need to revive this PR first: feat: enable ssr on /privacy-policy #9155. The thing is, the PR is not related to EVM. Should I revive that PR again?

Originally posted by @preschian in #10370 (reply in thread)

@exezbcz
Copy link
Member Author

exezbcz commented Jun 8, 2024

have you found anything @hassnian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 - clean-up A-explorer p1 preventing everyone from using app
Projects
None yet
Development

No branches or pull requests

2 participants