Compress Lunr index files
What does this MR do and why?
Creates gzip versions of the Lunr search index JSON files.
This will improve frontend performance on pages that include these files.
Closes #1671 (closed)
Screenshots, screen recordings, or links to review app
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Compile the site ( make compile
), then build the Lunr index:make build-lunr-index
-
Verify that public/assets/javascripts
contains these compressed files:lunr-index.json.gz
andlunr-map.json.gz
, in addition to the non-compressed versions (same names, minus the.gz
)
Your local web server (make view
) won't serve the compressed file, but you can see it on the review app: https://compress-lunr-indexes.docs.gitlab-review.app/search/?q=testing (use browser dev tools as shown in the screenshots, or you can test with cURL, like this: curl -IH 'Accept-encoding: gzip' https://compress-lunr-indexes.docs.gitlab-review.app/assets/javascripts/lunr-index.json
)
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.