Choose a version:
48% The original file has 447387 bytes (436.9k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 212671 bytes (207.7k, 48%).

After GZIP compression these minified files vary in size:
Boot
  81470 bytes (79.6k)
CDN, direct link
cdnjs
  72008 bytes (70.3k)
CDN, direct link
cdnhttps
  71795 bytes (70.1k)
CDN, direct link
gzip -6 (default)
  71418 bytes (69.7k)
local copy
gzip -9
  71182 bytes (69.5k)
local copy
libdeflate -12
  68444 bytes (66.8k)
local copy
7zip -mx=9 -tgzip
  68006 bytes (66.4k)
local copy
kzip -s0 -rn -b8
  67618 bytes (66.0k)
local copy
pigz -11 -n
  67588 bytes (66.0k)
local copy
Zopfli
  67495 bytes (65.9k)
local copy
Zopfli (defluff)
  67491 bytes (65.9k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/d3/d3-4.2.8.min.js

You will automatically get the smallest D3 4.2.8 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 4300 bytes by using my D3 4.2.8 Zopfli version instead of the best available CDN (6.37% smaller than cdnhttps, 67495 vs. 71795 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 --mls4096 --bsr4 --lazy --ohh

(found October 21, 2016)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 4  --bsr4
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 4 more bytes (67491 bytes).

Verify file integrity

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

MD5:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.2.8/d3.zip --location | md5sum
db69fb2626a71a286ee772d673138aca  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-4.2.8.min.zopfli.js.gz | md5sum
db69fb2626a71a286ee772d673138aca  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.2.8/d3.zip --location | sha1sum
ffb025552f9458232ef95260339876b278111c42  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-4.2.8.min.zopfli.js.gz | sha1sum
ffb025552f9458232ef95260339876b278111c42  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 81470 bytes db69fb2626a71a286ee772d673138aca October 21, 2016 @ 06:16
cdnjs 72008 bytes db69fb2626a71a286ee772d673138aca October 20, 2016 @ 20:17
cdnhttps 71795 bytes db69fb2626a71a286ee772d673138aca November 22, 2016 @ 16:32

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

Other Versions

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

4.10.0,
4.9.1, 4.9.0, 4.8.0, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.0, 4.5.0, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.0, 4.2.8, 4.2.7, 4.2.6, 4.2.5, 4.2.4, 4.2.3, 4.2.2, 4.2.1, 4.2.0, 4.1.1, 4.1.0, 4.0.0,
3.5.17, 3.5.16, 3.5.15, 3.5.14, 3.5.13, 3.5.12, 3.5.11, 3.5.10, 3.5.9, 3.5.8, 3.5.7, 3.5.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.13, 3.4.12, 3.4.11, 3.4.10, 3.4.9, 3.4.8, 3.4.6, 3.4.5, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.13, 3.3.12, 3.3.11, 3.3.10, 3.3.9, 3.3.8, 3.3.7, 3.3.6, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3.0, 3.2.8, 3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.1.10, 3.1.9, 3.1.8, 3.1.7, 3.1.6, 3.1.5, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0

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

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
67495 bytes -6 bytes zopfli --i1000000 --mls4096 --bsr4 --lazy --ohh October 21, 2016 @ 23:34
67501 bytes -8 bytes zopfli --i100000 --mls4096 --bsr4 --lazy --ohh October 21, 2016 @ 11:33
67509 bytes -4 bytes zopfli --i10000 --mls4096 --bsr4 --lazy --ohh October 21, 2016 @ 10:10
67513 bytes -18 bytes zopfli --i1000 --mls4096 --bsr4 --lazy --ohh October 21, 2016 @ 10:04
67531 bytes zopfli --i100 --mls4096 --bsr4 --lazy --ohh October 21, 2016 @ 10:01

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

Most recent activity on January 25, 2017 @ 15:28.

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
67727 67730 67867 67857 67805 67851 67801 67806 67838 67909 68003 68020 68032 67931 67922
67597 67706 67548 67553 67592 67710 68385 67657 67571 67576 67585 67495 67572 67626 67693
68376 67670 67670 68389 67670 67664 67656 67660 67716 67666 67534 67646 67588 68382 67710
67669 67698 67639 68375 67653 68369 67712 67662 67669 67645 67634 68346 67576 68386 67720
67765 67770 67648 68363 68371 68370 67650 67656 67650 67675 67636 68351 67518 68383 67639
67671 67729 67655 67665 67673 68370 67626 67644 68332 67637 67636 68339 67642 68384 68371
68354 67640 67676 68348 67628 67633 67632 67625 67629 67650 67658 67702 67643 67702 67675
67677 67686 68347 68340 68333 67634 67627 67629 67635 67636 67632 67640 67661 68358 68349
67641 67651 68349 68349 68333 68349 67625 67620 67621 67638 67668 68330 68343 68359 67716
67629 67643 67638 68344 67629 67644 67626 67638 68331 67637 67627 67634 68358 68356 67692
67638 67643 67629 68343 67628 67638 67623 67627 67623 67635 67637 68354 67623 67670 67693
67626 67643 67642 68351 67630 68344 67634 67635 68331 67635 67626 67627 67627 68365 67721
67640 67651 67634 68342 68352 67632 67622 68348 67630 67638 67637 68337 67676 68355 67690
67638 67644 67635 68341 67632 68335 67636 67629 67641 67648 67633 68347 67652 68355 68351
67637 67634 67632 68358 68352 68339 67629 67641 67640 67630 67665 67709 67650 67665 67693
67642 67634 67634 68341 68336 67626 67629 67627 67640 67625 67635 68343 67658 68368 68356
67642 67641 67640 68355 68352 67638 67628 67628 67629 67644 68338 67639 67629 68350 67694
67643 67637 67624 68358 68360 68342 67631 67632 68331 67636 67627 67640 67651 68386 67692
67644 67643 68341 68349 68352 67628 67623 67634 68331 67636 67632 67636 67626 68360 67692
67642 67650 67635 68339 68343 67625 67630 67627 68337 67644 67627 68336 67672 68360 67691
67647 67643 67638 68345 67640 67635 67626 67634 68327 67648 68337 68351 67653 67701 67682
67651 67644 67638 68346 68341 67644 67629 67633 67644 67663 67638 67673 67659 68365 67693
67655 67645 67661 68339 68344 67672 67667 67666 67636 67627 67670 67662 67649 67694 67693

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 67531 bytes 100%
1,000 67513 bytes -18 bytes 100%
10,000 67509 bytes -4 bytes 100%
100,000 67501 bytes -8 bytes 1.16%
1,000,000 67495 bytes -6 bytes 0.29%
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
67640 bytes +145 bytes (+0.21%) +22 bytes
69088 bytes +1593 bytes (+2.36%) +1470 bytes
68954 bytes +1459 bytes (+2.16%) +1336 bytes
68580 bytes +1085 bytes (+1.61%) +962 bytes
67887 bytes +392 bytes (+0.58%) +269 bytes
67784 bytes +289 bytes (+0.43%) +166 bytes
67778 bytes +283 bytes (+0.42%) +160 bytes
67641 bytes +146 bytes (+0.22%) +23 bytes
67618 bytes +123 bytes (+0.18%)

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 53490 bytes -14005 bytes (-20.75%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 59474 bytes -8021 bytes (-11.88%)
LZMA2 (Wikipedia) xz xz -9 60232 bytes -7263 bytes (-10.76%)
Brotli (Wikipedia) brotli brotli -q 11 60451 bytes -7044 bytes (-10.44%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 61812 bytes -5683 bytes (-8.42%)
ZSTD (Wikipedia) zstd zstd -19 65557 bytes -1938 bytes (-2.87%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 66843 bytes -652 bytes (-0.97%)

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 2017.
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