Skip to content

Pagefind search is eagerly loading all results #212

Open

Description

@bglw

Heya — just floating that the Pagefind search implementation here feels a bit slower than it otherwise could, mainly as the data for all results is loaded up front. If you peep the network tab during a search, the fragments for all results have to load first which slows things down.

The best strategy is to lazy load the data for each result on scroll using an IntersectionObserver, if at all possible, so that only the visible results load their data at any given time :) (nb: 1.5 is also just blanket faster but that's tangential).

If this is the sorta thing you'd toss an agent at, the new pagefind-results.ts component has all the patterns one would want to replicate for a snappier feel.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions