-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Reduce Solr Load by Switching Related Book Carousels to Lazy Load only after visible in viewport #10354
Comments
Hi @mekarpeles, @RayBB, |
@ShilpThapak
|
Hi, @mekarpeles, @RayBB Optimization of Related Books Carousel LoadingTask Breakdown
Proposed SolutionApproach
Implementation Steps
Benefits
|
@RayBB, you can assign this issue to Mohit if you like his proposal. |
Thank you, @ShilpThapak, for referring me! |
@dev-mohit06 sounds like a good proposal. Is a specific JavaScript framework/library in use (e.g., React, Vue.js, or plain JS)?
Are there existing utilities for lazy loading in the codebase that need to be reused?
Should there be a fallback mechanism for browsers without Intersection Observer support?
Is performance optimization critical? Should we prefetch data for carousels near the viewport?
Let me know if you have further questions. |
As of now, I don’t have it, but if I do, I will definitely ask. |
Are you working on this? If not then I can work on this. |
@PredictiveManish Yes, I am currently working on it and figuring out the best approach to proceed. |
@RayBB, I am experiencing some issues while setting up the Open Library project. Could you please assist me in resolving them? |
Please explain the issue in detail with the exact commands you run and errors you see |
After all the steps when I am giving the command
it is not building images completely but it shows created everything, but when I use
It doesn't starts the setup
Showing all images but unable to see project locally I mentioned the issue in discussion channel on gitter. |
Hi @RayBB, I’m facing an issue while trying to run OpenLibrary using Docker on my MacBook Air with an M2 chip. After running the docker-compose up command, I encountered the following error Could you help me figure out what’s going wrong? Thanks! |
@PredictiveManish, I’ve been assigned this issue by @RayBB, so please refrain from working on it. Feel free to focus on other tasks. |
@RayBB, it might be helpful to remove the “Needs: Response” tag from this issue, as I’ve been assigned to resolve it. Thank you! |
@dev-mohit06, can you try to update the file |
@ShilpThapak Thanks a lot |
Brother I am not working on this issue, I am working on other issue. I was just have to reset my laptop due to some issues and now when I am setting up the project I am facing some trouble so that's why I had sent these images here as someone else is also facing trouble. |
Thanks for clarifying, @PredictiveManish. Appreciate you letting me know. If you’re facing issues while setting up the project, feel free to share the details, and I’ll try to help if I can. |
If you can see in gitter community I had shared my issues, or please see it above messaging again will make trouble to others too. |
TL;DR
Can we optimize RelatedCarousels (that show up on every book page so that these carousels (which are already async loaded by a partial) only fetch once the component is in viewport (via js)?
Background
Openlibrary.org is a web site that has a page for every book published. The main page is the "book" page (which showcases information about a book). One section/component is called Related Books Carousel which currently loads async, far below the fold. It calls an endpoint call
/partials.json?component=relatedBooks
. We'd like to change this code so that the partial is only called when the component comes into view or the patron is scrolling towards it (i.e. it's in range of the viewport). One consideration is the patron may click an anchor link (jump to section) to get to the carousels and so relying on scrolling may not be sufficient.We could implement with a library like lozad or vanilla-lazyload.
Solution
ChatGPT recommends the
Intersection Observer API
gating our existing fetch code hereopenlibrary/openlibrary/plugins/openlibrary/js/carousels_partials.js
Lines 3 to 29 in 3e18ea8
e.g.
Process Notes
We may wish to coordinate with staff turn off related book carousels on book pages for some period of time (like 1h) to see how overall performance is impacted before moving forward with implementation.
Justification
Improve Open Library performance by decreasing number of calls to solr API
Breakdown
Requirements Checklist
Related files
openlibrary/openlibrary/plugins/openlibrary/js/carousels_partials.js
Lines 3 to 29 in 3e18ea8
Stakeholders
Instructions for Contributors
Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
The text was updated successfully, but these errors were encountered: