apache / apache/apisix-website
speed up loading JS assets
- Dominant language
- JavaScript
- Stars
- 146
- Forks
- 204
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 21
Description
**Actual Behaviour**
Hi, we're using https://docusaurus.io/ V2 to build our website, when it's built after running `yarn build`, it will generate many JS assets under the `build/assets/js/` directory, e.g https://github.com/apache/apisix-website/tree/asf-site/assets/js
And when we visit our website, it will first load the `runtime~main.xxxx.js` file, and it will load all necessary other JS assets asynchronously, but with `relative URL` like the following screenshot:

**Expected Behaviour**
`https://apisix.apache.org/assets/js/69365.a39fd14a.js`.
This URL is correct but I would suggest that we load them from jsDelivr, too. So users in China could visit faster.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the asset loading after running `yarn build`, focusing on `build/assets/js/` and the `runtime~main.xxxx.js` entry described in the issue. Trace where the relative asynchronous asset URLs are generated and verify that the resulting URLs use jsDelivr while the website still loads all required JavaScript.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100