jameslittle230 / stork

🔎 Impossibly fast web search, made for static sites.
https://stork-search.net
Apache License 2.0
2.73k stars 56 forks source link

Stork freezes the page on iOS when search index is >20MB #361

Open ezekg opened 1 year ago

ezekg commented 1 year ago

I'm not sure if it's specific to iOS or specifically >20MB, but I've noticed that the stork.register call freezes the page when the search index is large, even when the script is loaded async. When I call stork.register, the page freezes for a couple seconds until the search index is downloaded and ready to use. Is there a way to load a search index truly asynchronously?

I also have it gzipped down to 1MB, but it still loads slow and freezes the page (can't scroll or interact). So maybe it's not the initial download, but something Stork is doing synchronously during initialization.

Let me know if you want a copy of the search index, or even access to the website's source code itself (it's a static site).

Due to this, I had to temporarily disable Stork on Keygen while I determine a fix.

Kristinita commented 9 months ago

I’m reproducing this problem.

1. Description of the problem

On iOS devices on the BrowserStack, Stork, that using my 24.2 megabyte index file, may:

  1. take more than 10 seconds to load,
  2. block the display of other elements of the web page during loading.

This is a critical problem that forced me to remove Stork from my site.

I don’t reproduce the problem in browsers on Windows, macOS and Android operating systems when testing in the BrowserStack.

2. Demonstration

I saved the Stork search to the page 404 of my site. You can check out how this page with Stork works on iOS and other operating systems.

My index file search-index.st.

3. Environment

BrowserStack’s environment:

  1. iOS 17.1
  2. iPhone 15 Pro Max and iPad Pro 12.9 2021
  3. Browsers Safari and Chrome

Thanks.