You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: replace gzip with precompress
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
* 📄 Update LLMs.txt snapshot for PR review
* docs: brotli
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
* 📄 Update LLMs.txt snapshot for PR review
* docs: note
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
* 📄 Update LLMs.txt snapshot for PR review
---------
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .llms-snapshots/llms-full.txt
+82-12Lines changed: 82 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1675,7 +1675,7 @@ You can customize your hosting environment to fit your needs, including:
1675
1675
* Serve a customized 404 page. ([Learn how.](#customize-a-404not-found-page))
1676
1676
* Set up `redirects` for pages that you've moved or deleted. ([Learn how.](#redirects))
1677
1677
* Set up `rewrites`. ([Learn how.](#rewrites))
1678
-
* Tweak `gzip` compression for best performance. ([Learn how.](#gzip))
1678
+
* Customize file `compression` for optimal performance. ([Learn how.](#precompress))
1679
1679
* Customize the `encoding` behavior of your files. ([Learn how.](#encoding-types))
1680
1680
* Allow your project to be embedded as an `iframe`. ([Learn how.](#iframe))
1681
1681
* Customize `assertions` to modify the default verification behavior of the CLI. ([Learn how.](#assertions))
@@ -1804,24 +1804,59 @@ This `source` attribute works similarly to Git's `.gitignore`, and you can speci
1804
1804
1805
1805
### GZIP
1806
1806
1807
-
When deploying your application, the CLI automatically searches for JavaScript (js), ES Module (mjs), and CSS (css) files in the `source` folder and optimizes them using Gzip compression. This is useful because neither the protocol nor a satellite can compress these files, ensuring the best web performance.
1807
+
When deploying your application, the CLI automatically searches for JavaScript (js), ES Module (mjs), CSS (css) and HTML (html) files in the `source` folder to optimize them using Gzip compression. This improves the performance of your app when it is served on the web.
1808
1808
1809
-
If you wish to customize this behavior, you have the option to disable it or provide a different file matching pattern using glob syntax.
1809
+
By default, precompression stores **both** the original and compressed versions in Storage.
1810
1810
1811
-
To opt-out of Gzip compression, simply set the `gzip` option to `false` in your configuration:
1811
+
You can disable it entirely or customize which files are precompressed, whether to keep originals, and which compression algorithm to use.
1812
+
1813
+
**Note:**
1814
+
1815
+
If you change the precompress configuration and your project has already been deployed, run `juno clear` before redeploying to ensure you change is applied.
1816
+
1817
+
## Disable precompression
1818
+
1819
+
Set the `precompress` option to `false` in your configuration:
By default, precompression uses **Gzip** (`algorithm: "gzip"`) because it offers a good balance between compression speed, compatibility, and size.
1853
+
1854
+
You can switch to **Brotli** (`algorithm: "brotli"`) for potentially smaller files, especially for text-based assets such as those compressed by default like HTML, CSS, and JavaScript.
When deploying your application, the CLI automatically searches for JavaScript (js), ES Module (mjs), and CSS (css) files in the `source` folder and optimizes them using Gzip compression. This is useful because neither the protocol nor a satellite can compress these files, ensuring the best web performance.
7898
+
When deploying your application, the CLI automatically searches for JavaScript (js), ES Module (mjs), CSS (css) and HTML (html) files in the `source` folder to optimize them using Gzip compression. This improves the performance of your app when it is served on the web.
7864
7899
7865
-
If you wish to customize this behavior, you have the option to disable it or provide a different file matching pattern using glob syntax.
7900
+
By default, precompression stores **both** the original and compressed versions in Storage.
7866
7901
7867
-
To opt-out of Gzip compression, simply set the `gzip` option to `false` in your configuration:
7902
+
You can disable it entirely or customize which files are precompressed, whether to keep originals, and which compression algorithm to use.
7903
+
7904
+
**Note:**
7905
+
7906
+
If you change the precompress configuration and your project has already been deployed, run `juno clear` before redeploying to ensure you change is applied.
7907
+
7908
+
## Disable precompression
7909
+
7910
+
Set the `precompress` option to `false` in your configuration:
By default, precompression uses **Gzip** (`algorithm: "gzip"`) because it offers a good balance between compression speed, compatibility, and size.
7944
+
7945
+
You can switch to **Brotli** (`algorithm: "brotli"`) for potentially smaller files, especially for text-based assets such as those compressed by default like HTML, CSS, and JavaScript.
When deploying your application, the CLI automatically searches for JavaScript (js), ES Module (mjs), CSS (css) and HTML (html) files in the `source` folder to optimize them using Gzip compression. This improves the performance of your app when it is served on the web.
2
+
3
+
By default, precompression stores **both** the original and compressed versions in Storage.
4
+
5
+
You can disable it entirely or customize which files are precompressed, whether to keep originals, and which compression algorithm to use.
6
+
7
+
:::note
8
+
9
+
If you change the precompress configuration and your project has already been deployed, run `juno clear` before redeploying to ensure you change is applied.
10
+
11
+
:::
12
+
13
+
## Disable precompression
14
+
15
+
Set the `precompress` option to `false` in your configuration:
16
+
17
+
```javascript title="juno.config.js"
18
+
import { defineConfig } from"@junobuild/config";
19
+
20
+
exportdefaultdefineConfig({
21
+
satellite: {
22
+
ids: {
23
+
production:"qsgjb-riaaa-aaaaa-aaaga-cai"
24
+
},
25
+
source:"dist",
26
+
precompress:false
27
+
}
28
+
});
29
+
```
30
+
31
+
## Customize the file matching pattern
32
+
33
+
If you want to customize the default pattern `**/*.+(css|js|mjs|html)` to better suit your needs, you can specify your own pattern. For example:
34
+
35
+
```javascript title="juno.config.js"
36
+
import { defineConfig } from"@junobuild/config";
37
+
38
+
exportdefaultdefineConfig({
39
+
satellite: {
40
+
ids: {
41
+
production:"qsgjb-riaaa-aaaaa-aaaga-cai"
42
+
},
43
+
source:"dist",
44
+
precompress: {
45
+
pattern:"**/*.jpg"// precompress JPEG files only
46
+
}
47
+
}
48
+
});
49
+
```
50
+
51
+
## Decide what happens to original files
52
+
53
+
The `mode` option controls what happens to the original files after compression:
54
+
55
+
-`"both"` — upload both the original and the compressed version. _(default)_
56
+
-`"replace"` — upload only the compressed version and serve it with the appropriate `Content-Encoding` header.
57
+
58
+
```javascript title="juno.config.js"
59
+
import { defineConfig } from"@junobuild/config";
60
+
61
+
exportdefaultdefineConfig({
62
+
satellite: {
63
+
ids: {
64
+
production:"qsgjb-riaaa-aaaaa-aaaga-cai"
65
+
},
66
+
source:"dist",
67
+
precompress: {
68
+
mode:"replace"
69
+
}
70
+
}
71
+
});
72
+
```
73
+
74
+
## Choose the compression algorithm
75
+
76
+
By default, precompression uses **Gzip** (`algorithm: "gzip"`) because it offers a good balance between compression speed, compatibility, and size.
77
+
78
+
You can switch to **Brotli** (`algorithm: "brotli"`) for potentially smaller files, especially for text-based assets such as those compressed by default like HTML, CSS, and JavaScript.
0 commit comments