Last active
January 3, 2025 10:53
-
-
Save TobiX/9daa43186bcd80071fcfe726f91c9bc6 to your computer and use it in GitHub Desktop.
Revisions
-
TobiX revised this gist
Apr 24, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ This needs a directory with 3 precompressed files, which may be created like thi more/less bandwith to spare or want to annoy "visitors" more/less): ```sh dd if=/dev/zero bs=1M count=10240 status=progress | gzip -9 > 42.gzip dd if=/dev/zero bs=1M count=102400 status=progress | brotli > 42.br dd if=/dev/zero bs=1M count=102400 status=progress | zstd -9 -T0 > 42.zstd ``` I got these compression ratios: -
TobiX revised this gist
Feb 8, 2024 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,10 @@ vars @is_br compression br @is_zstd header Accept-Encoding *zstd* vars @is_zstd compression zstd header { Content-Encoding {vars.compression} Content-Type "text/html; charset=utf-8" } rewrite * /42.{vars.compression} file_server } -
TobiX revised this gist
Feb 8, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ dd if=/dev/zero bs=1M count=102400 | zstd -9 -T0 > 42.zstd I got these compression ratios: File | Compressed | Uncompressed --------|------------|------------- 42.gzip | 9.937 MiB | 10 GiB 42.br | 82.032 KiB | 100 GiB 42.zstd | 3.17 MiB | 100 GiB -
TobiX created this gist
Feb 8, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # Tar pit @shit { path */.env path /wp-login.php } handle @shit { root * /srv/www vars compression gzip @is_br header Accept-Encoding *br* vars @is_br compression br @is_zstd header Accept-Encoding *zstd* vars @is_zstd compression zstd header Content-Encoding {vars.compression} rewrite * /42.{vars.compression} file_server } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ This is a silly snippet of caddy config file to send heavily compressed huge files to clients prodding "stupid" URLs. (idea from https://tech.lgbt/@becomethewaifu/111879788755441482) This needs a directory with 3 precompressed files, which may be created like this (tune numbers if you have more/less bandwith to spare or want to annoy "visitors" more/less): ```sh dd if=/dev/zero bs=1M count=10240 | gzip -9 > 42.gzip dd if=/dev/zero bs=1M count=102400 | brotli > 42.br dd if=/dev/zero bs=1M count=102400 | zstd -9 -T0 > 42.zstd ``` I got these compression ratios: File | Compressed | Uncompressed 42.gzip | 9.937 MiB | 10 GiB 42.br | 82.032 KiB | 100 GiB 42.zstd | 3.17 MiB | 100 GiB