mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
Use brotli_static with max brotli compression
Compress with brotli ahead of time in CI, just like we do with zopfli for gzip_static Update hintrc to check for brotli compression. Update lighthouse config to throttle CPU some more since brotli decompression can be heavier.
This commit is contained in:
parent
2083f1aed5
commit
0c64c5867b
5 changed files with 10 additions and 15 deletions
|
@ -2,7 +2,8 @@
|
|||
image: alpine/edge
|
||||
packages:
|
||||
- rsync
|
||||
- zopfli
|
||||
- zopfli # for max compression with gzip_static
|
||||
- brotli # for max compression with brotli_static
|
||||
- git # for Hugo's gitInfo
|
||||
- make
|
||||
- npm # for testing with lighthouse and webhint
|
||||
|
|
12
.hintrc
12
.hintrc
|
@ -34,17 +34,7 @@
|
|||
}
|
||||
],
|
||||
"doctype": "error",
|
||||
"http-compression": [
|
||||
"warning",
|
||||
{
|
||||
"html": {
|
||||
"brotli": false
|
||||
},
|
||||
"resource": {
|
||||
"brotli": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"http-compression": "error",
|
||||
"https-only": "error",
|
||||
"manifest-file-extension": "error",
|
||||
"manifest-is-valid": "error",
|
||||
|
|
|
@ -56,7 +56,7 @@ ci:
|
|||
- offline-start-url
|
||||
- offscreen-images
|
||||
throttling:
|
||||
cpuSlowdownMultiplier: 3.4 # seems about right on builds.sr.ht
|
||||
cpuSlowdownMultiplier: 4.2 # seems about right on builds.sr.ht
|
||||
throttlingMethod: devtools
|
||||
url:
|
||||
- https://staging.seirdy.one/
|
||||
|
|
5
Makefile
5
Makefile
|
@ -63,10 +63,13 @@ test: lint-css hint-devserver check-links
|
|||
.PHONY: build
|
||||
build: hugo
|
||||
# gzip_static + max zopfli compression
|
||||
ifndef NO_GZIP_STATIC
|
||||
ifndef NO_STATIC
|
||||
find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' \
|
||||
| grep -v gemini \
|
||||
| xargs zopfli --i$(ZOPFLI_ITERATIONS) --gzip
|
||||
find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' \
|
||||
| grep -v gemini \
|
||||
| xargs brotli -q 11
|
||||
endif
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@ To build:
|
|||
- Hugo 0.75 or later
|
||||
- Make
|
||||
- Git (Hugo uses Git info for features like date last updated)
|
||||
- Zopfli (optional; set `NO_GZIP_STATIC=1` to disable)
|
||||
- Zopfli (optional; set `NO_STATIC=1` to disable)
|
||||
- Brotli (optional; set `NO_STATIC=1` to disable)
|
||||
- POSIX utils: grep, find, etc.
|
||||
|
||||
To deploy:
|
||||
|
|
Loading…
Reference in a new issue