Choose a version:
21% The original file has 318139 bytes (310.7k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 68249 bytes (66.6k, 21%).

After GZIP compression these minified files vary in size:
unpkg
  29074 bytes (28.4k)
CDN
gzip -6 (default)
  25144 bytes (24.6k)
local copy
gzip -9
  25098 bytes (24.5k)
local copy
7zip -mx=9 -tgzip
  24345 bytes (23.8k)
local copy
libdeflate -12
  24317 bytes (23.7k)
local copy
kzip -s0 -rn -b2
  24307 bytes (23.7k)
local copy
zultra
  24277 bytes (23.7k)
local copy
pigz -11 -n
  24273 bytes (23.7k)
local copy
Zopfli
  24255 bytes (23.7k)
local copy
Zopfli (defluff)
  24254 bytes (23.7k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/knockout/knockout-3.5.1.min.js (or via HTTPS)

You will automatically get the smallest Knockout 3.5.1 file, ETag caching is available and
if your browser doesn't support GZIP decompression then the uncompressed version will be sent.

Currently best Zopfli settings

Save 4819 bytes by using my Knockout 3.5.1 Zopfli version instead of the best available CDN (19.87% smaller than unpkg, 24255 vs. 29074 bytes):
You can use my super-compressed files for whatever purpose you like as long as you respect the library's original license agreement.
There are no restrictions from my side - but please avoid hot-linking if you run a high-traffic website.

These command-line settings yielded the best compression ratio so far (Linux version of zopfli-krzymod):
zopfli --i1000000 --mb8 --mls8192 --bsr18 --lazy --ohh

(found November 12, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 18  --bsr18
lazy matching in LZ77 yes  --lazy
optimized Huffman headers yes  --ohh
initial random W for iterations 1  --rw1
initial random Z for iterations 2  --rz2

Even Smaller Files Thanks To Defluff

Zopfli's output can be further optimized by the defluff tool.
In this particular case, defluff saves 1 more byte (24254 bytes).

Verify file integrity

After decompression, my uncompressed files are identical to the original ones:

MD5:
curl --silent --compressed https://knockoutjs.com/downloads/knockout-3.5.1.js --location | md5sum
0b0128ab9e61554877cbb24986c24f04  -
curl --silent --compressed https://minime.stephan-brumme.com/files/knockout/knockout-3.5.1.min.zopfli.js.gz | md5sum
0b0128ab9e61554877cbb24986c24f04  -

SHA1:
curl --silent --compressed https://knockoutjs.com/downloads/knockout-3.5.1.js --location | sha1sum
30f5c25060787c4fb0fd4a45ee48d82c683145da  -
curl --silent --compressed https://minime.stephan-brumme.com/files/knockout/knockout-3.5.1.min.zopfli.js.gz | sha1sum
30f5c25060787c4fb0fd4a45ee48d82c683145da  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 29074 bytes 0b0128ab9e61554877cbb24986c24f04 (invalid)

Note: only the MD5 hashes are shown to keep things simple.

Other Versions

Available Knockout versions at minime.stephan-brumme.com:

3.5.1, 3.5.0,
3.4.2, 3.4.1, 3.4.0,
3.3.0,
3.2.0,
3.1.0, 3.0.0,
2.3.0,
2.2.1, 2.2.0,
2.1.0, 2.0.0,
1.2.1, 1.2.0,
1.1.2, 1.1.1, 1.1.0

The project site contains an overview how well these versions were compressed.
Other interesting projects are AngularJS, BackboneJS, Bootstrap, D3, Dojo, Ember, jQuery, lodash, React, Socket.IO, ThreeJS, UnderscoreJS and Vue.

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
24255 bytes -1 byte zopfli --i1000000 --mls8192 --bsr18 --lazy --ohh November 12, 2019 @ 13:24
24256 bytes -1 byte zopfli --i100000 --mls4096 --bsr13 --lazy --ohh November 11, 2019 @ 18:09
24257 bytes -1 byte zopfli --i100000 --mls8192 --bsr20 --lazy --ohh November 11, 2019 @ 16:44
24258 bytes -3 bytes zopfli --i10000 --mls8192 --bsr20 --lazy --ohh November 11, 2019 @ 16:14
24261 bytes -1 byte zopfli --i1000 --mls8192 --bsr20 --lazy --ohh November 11, 2019 @ 16:00
24262 bytes -1 byte zopfli --i1000 --mls8192 --bsr25 --lazy --ohh November 11, 2019 @ 15:59
24263 bytes -1 byte zopfli --i1000 --mls8192 --bsr18 --lazy --ohh November 11, 2019 @ 15:59
24264 bytes -2 bytes zopfli --i1000 --mls4096 --bsr10 --lazy --ohh November 11, 2019 @ 15:59
24266 bytes zopfli --i100 --mls4096 --bsr13 --lazy --ohh November 11, 2019 @ 15:40

If there are multiple parameter sets yielding the same compressed size, only the first one found is shown.

Most recent activity on July 20, 2020 @ 12:51.

Heatmaps

This Zopfli heatmap visualizes how compression changes when modifying the --bsr and --mls parameter.
Cell's contents is the best filesize achieved (in bytes, hover with mouse over cells to see number of iterations).

Good parameters are green, bad are red. The best and worst are bold as well.
The brightness of the blue background color indicates how many iterations were processed:
10,000, 100,000 or 1,000,000.
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
24275 24277 24275 24276 24276 24275 24277 24277 24277 24273 24277 24264 24268 24282 24275
24267 24272 24272 24275 24272 24273 24273 24268 24266 24274 24266 24266 24261 24271 24279
24266 24271 24266 24267 24269 24274 24268 24268 24266 24274 24266 24261 24264 24273 24265
24268 24267 24266 24267 24267 24272 24275 24275 24266 24266 24266 24266 24274 24274 24265
24266 24277 24266 24270 24267 24276 24267 24267 24266 24266 24272 24263 24274 24269 24262
24266 24269 24266 24266 24267 24270 24266 24269 24267 24267 24266 24262 24261 24269 24275
24267 24271 24267 24266 24267 24267 24266 24269 24266 24267 24267 24261 24258 24269 24263
24267 24271 24266 24267 24269 24271 24266 24269 24266 24266 24266 24257 24264 24274 24263
24266 24269 24266 24267 24267 24266 24268 24268 24266 24267 24266 24262 24264 24276 24263
24266 24270 24266 24266 24267 24271 24266 24269 24267 24274 24266 24256 24275 24269 24274
24267 24269 24267 24267 24267 24271 24276 24274 24266 24267 24267 24268 24264 24267 24261
24267 24271 24268 24267 24269 24272 24276 24275 24266 24266 24267 24258 24257 24269 24263
24267 24271 24266 24270 24267 24271 24276 24266 24266 24267 24267 24263 24262 24268 24263
24266 24271 24266 24267 24267 24266 24266 24269 24266 24267 24267 24262 24264 24273 24263
24270 24271 24266 24270 24270 24270 24266 24269 24266 24266 24266 24263 24255 24269 24263
24267 24266 24266 24274 24266 24273 24266 24269 24267 24266 24266 24261 24257 24270 24272
24269 24271 24266 24266 24266 24271 24267 24269 24267 24266 24267 24261 24257 24269 24265
24266 24271 24266 24267 24267 24274 24267 24267 24266 24274 24267 24263 24264 24276 24265
24266 24271 24266 24266 24267 24272 24266 24266 24266 24267 24266 24264 24257 24267 24265
24266 24271 24266 24266 24269 24270 24267 24266 24267 24267 24267 24263 24274 24274 24263
24266 24270 24266 24266 24269 24270 24266 24268 24267 24267 24267 24263 24257 24274 24265
24267 24269 24266 24267 24267 24266 24266 24269 24266 24266 24266 24263 24258 24269 24274
24267 24271 24266 24267 24267 24270 24266 24269 24267 24267 24266 24263 24274 24274 24274

Due to the Monte Carlo design of my search algorithm, not all parameters have reached the same number of iterations yet:
Iterations Min. Bytes Reduction Coverage
100 24266 bytes 100%
1,000 24261 bytes -5 bytes 100%
10,000 24258 bytes -3 bytes 100%
100,000 24256 bytes -2 bytes 3.19%
1,000,000 24255 bytes -1 byte 0.58%
10,000,000

KZIP has far less options available for tuning/optimization. I only played around with the number of blocks (parameter -n):
Blocks Min. Bytes Compared To Best Zopfli Compared To Best KZIP
24359 bytes +104 bytes (+0.43%) +52 bytes
24359 bytes +104 bytes (+0.43%) +52 bytes
24307 bytes +52 bytes (+0.21%)
24329 bytes +74 bytes (+0.31%) +22 bytes
24312 bytes +57 bytes (+0.24%) +5 bytes
24359 bytes +104 bytes (+0.43%) +52 bytes
24403 bytes +148 bytes (+0.61%) +96 bytes
24439 bytes +184 bytes (+0.76%) +132 bytes
24468 bytes +213 bytes (+0.88%) +161 bytes

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
However, support for Brotli is constantly growing - but your browser doesn't support it.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 20332 bytes -3923 bytes (-16.17%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 20413 bytes -3842 bytes (-15.84%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 20497 bytes -3758 bytes (-15.49%)
Brotli (Wikipedia) brotli brotli -q 11 22343 bytes -1912 bytes (-7.88%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 22741 bytes -1514 bytes (-6.24%)
LZMA2 (Wikipedia) xz xz -9 23652 bytes -603 bytes (-2.49%)
Zstandard (Wikipedia) zstd zstd -19 24017 bytes -238 bytes (-0.98%)

Detailled Analysis

I wrote a DEFLATE decoder in Javascript. Click the button below to start a client-side analysis of the smallest gzipped files (may take a second):


Notes: pigz is a fast open source multi-threaded implementation of gzip written by one of the original authors of gzip.
However, when using compression level 11, pigz actually switches to the slower Zopfli algorithm and isn't multi-threaded anymore.
KrzyMOD's extensions to Zopfli offer the highest level of configuration and is therefore used for my brute-force search.
Ken Silverman wrote the closed-source KZIP compression program and Jonathon Fowler ported it to Linux.
Defluff was created by Joachim Henke; DeflOpt is a tool by Ben Jos Walbeehm.

website made by Stephan Brumme in 2015 and still improving in 2024.
all timestamps are displayed in central european time. see my changelog.
no flash, not even images or external css files - and everything squeezed into a single html file.
which was handsomely compressed before releasing it into the wild internet - obviously.

please visit my homepage and my blog, too.
email: minime (at) stephan-brumme.com

All trademarks are property of their respective owners. You know, the boring legal stuff.