rust-lang / rust-lang/simpleinfra
Enable Brotli in CloudFront settings for docs.rust-lang.org
Nobody has claimed this yet.
- Dominant language
- HCL
- Stars
- 178
- Forks
- 107
- Avg merge
- 15h 57m
- Merged PRs (30d)
- 38
Description
(Moving from https://github.com/rust-lang/rust/issues/82286)
We can achieve a significant decrease in file size by enabling Brotli compression, which is an option in CloudFront: https://aws.amazon.com/about-aws/whats-new/2020/09/cloudfront-brotli-compression/
Brotli has been supported in major browsers since 2016: https://en.wikipedia.org/wiki/Brotli
search-index1.50.0.js is currently served as 272,247 gzip bytes, but it could be served as 140,170 brotli bytes.
$ curl https://doc.rust-lang.org/search-index1.50.0.js --header "Accept-Encoding: gzip" -o search-index.js.gz
$ zcat search-index.js.gz | brotli > search-index.js.br
$ ls -l search-index.js.*
-rw-rw-r-- 1 jsha jsha 140170 Feb 18 23:56 search-index.js.br
-rw-rw-r-- 1 jsha jsha 272247 Feb 18 23:56 search-index.js.gz
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the CloudFront configuration for docs.rust-lang.org in this repository and review the linked AWS Brotli guidance. Enable Brotli for the distribution, then verify the deployed search-index1.50.0.js response with curl using an Accept-Encoding header and confirm the Brotli response is served.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100