Skip to content

search within ~10 seconds of page load is very slow #4751

@lidermanrony

Description

@lidermanrony

Operation System: (Windows or Linux or MacOS)
Windows
DocFX Version Used:
All of them
Template used: (default or statictoc or contain custom template)
default
Steps to Reproduce:

  1. browse to https://aka.ms/kusto
  2. any search within the ~10 seconds of page load will return only after 10 seconds passed from time page loads.

Expected Behavior:
wait less than a second.
This is very common in documentation websites to load the page and the immediately search.
Actual Behavior:
wait for more than 10 seconds

Looks like the issue is that lunr.js is building the index on-the-fly on page-load in a search-worker.js.
but this is a static website - the index can be persisted and then just loaded instead of building an index every time.

here is documentation on that from lunr.js website on how to use pre-build indexes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    searchSearch content for a static site

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions