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

"First Load JS" size is relatively large for some pages #309

Open
kartikver15gr8 opened this issue Jun 3, 2024 · 0 comments
Open

"First Load JS" size is relatively large for some pages #309

kartikver15gr8 opened this issue Jun 3, 2024 · 0 comments

Comments

@kartikver15gr8
Copy link

During the build, the size of First Load JS for some pages is quite large.

image

This higher First Load JS might impact the initial load performance, especially for users on slower networks or devices.

Areas of improvement

  1. Shared chunks: The shared chunks total to 492 kB. This includes framework, main, pages/_app, and webpack chunks. Reducing the size of these shared chunks will positively impact the initial load time for all pages.

  2. Page-Specific Chunks: Individual pages have their own sizes which contribute to the "First Load JS". For example, the homepage / has a size of 8.3 kB but requires 521 kB of JavaScript for the first load. This is because it includes the shared chunks.

We can fix this issue to enhance the overall performance of the application by taking following measures.

  1. Breaking down bigger components into smaller reusable/shared components
  2. Ensuring the app is taking advantage of Tree shaking that helps in getting rid of unused code.
  3. Caching & compressing the returning JS.

I'm currently working upon this issue, let me know if you're open to fix it.

Thank You!

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

No branches or pull requests

1 participant