globe-and-citizen / Celebrity-Fanalyzer

Celebrities Over Analyzed
https://celebrityfanalyzer.com
GNU General Public License v2.0
5 stars 12 forks source link

Lazy loading for prompts on the search page #463

Open marclupanc opened 1 month ago

marclupanc commented 1 month ago

Description

To enhance performance and speed up the initial load time of the app, I propose implementing lazy loading for prompts on the search page.

Implementation Plan

  1. Initial Load:

When the user first enters the search page, load only the prompts that fit on the screen plus an additional 2-3 prompts. This allows us to track intersection and scrolling events.

  1. Lazy Loading:

As the user scrolls down, fetch the next set of prompts in increments of 5-8. Continue this pattern to ensure smooth and efficient loading of prompts as the user navigates through the search page.

Expected Outcome

The speed of the first load on the search page should be significantly increased, providing a better user experience.

sana7044 commented 1 month ago

Lazy loading has already been implemented on the routes.

marclupanc commented 1 month ago

Here lazy loading means to fetch only visible prompts on first load of the search page, then on scroll when intersecting the last post visible fetch next prompts. I will add a description to this ticket.