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

Performance issue with huge amount of pre-rendered pages. #2

Open
KennFatt opened this issue Jun 8, 2021 · 1 comment
Open

Performance issue with huge amount of pre-rendered pages. #2

KennFatt opened this issue Jun 8, 2021 · 1 comment

Comments

@KennFatt
Copy link
Owner

KennFatt commented Jun 8, 2021

Problems / Solutions / Workaround

  1. Route /menus/[menuId] should not be pre-rendered. Instead, I can use useRouter() hook to handle dynamically client-side navigation.
    1. Remove /menus/index.js
    2. Make the /menus/[menuId] as a static page
    3. Rely on URL query and routes with useRouter() hook
    4. Implement fallback or loading indicator
    5. Fetch single data from /api route after component initially mounted.
  2. Route /menus/[menuId] pre-rendered not ahead-of-time but instead just-in-time.

Steps to reproduce

  • Initial page visit without cache hits.

EDIT:

  1. It wasn't because of the pre-rendered pages that causing performance issues on the client. I'll investigate it deeper later. I'm guessing it is because of browser extensions that interfere with performance while I'm auditing the page.
@KennFatt
Copy link
Owner Author

KennFatt commented Nov 14, 2021

The actual problem

FPS dropped when the user scrolling through the whole page that has background image. And It only happened in a few browsers (chrome-based browser, especially),

This following code seems cost extra for the browser to repaint the page:

  background-attachment: fixed;

And I did it in almost (or all) pages. See this line that I'm using bg-fixed util class.

Further reading:

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