Commit a678b373 authored by feistel's avatar feistel

Add support for brotli compressed pages

parent 2b9221d3
......@@ -173,7 +173,7 @@ Most modern browsers support downloading files in a compressed format. This
speeds up downloads by reducing the size of files.
Before serving an uncompressed file, Pages will check whether the same file
exists with a `.gz` extension. If it does, and the browser supports receiving
exists with a `.br` or `.gz` extension. If it does, and the browser supports receiving
compressed files, it will serve that version instead of the uncompressed one.
To take advantage of this feature, the artifact you upload to the Pages should
......@@ -182,14 +182,17 @@ have this structure:
```plaintext
public/
├─┬ index.html
│ | index.html.br
│ └ index.html.gz
├── css/
│ └─┬ main.css
│ | main.css.br
│ └ main.css.gz
└── js/
└─┬ main.js
| main.js.br
└ main.js.gz
```
......@@ -202,6 +205,7 @@ pages:
script:
# Build the public/ directory first
- find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
- find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec brotli -f -k {} \;
```
By pre-compressing the files and including both versions in the artifact, Pages
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment