Skip to content

Dox patch release: 2 December 2026

This release is patch versions only. The native server now opens, reads and sends a file in Rust, so static files are much faster and use less memory. The release also has security fixes. Your code needs no change.

Key takeaways

  • Faster static files. A 4 KB file does 4.2 times more requests a second. A 1 MB file does 5.1 times more. See Benchmark.
  • Less memory. On the 1 MB file test, the peak memory goes from 518 MiB to 78 MiB.
  • New: precompressed files. Route.staticFiles can send the .br and .gz files that your build made.
  • Faster TLS under a burst of new connections. With 4,096 new connections, the p99 goes from 1.1-1.4 s to 94-112 ms.
  • Security fixes. One fix is for static folders on Windows. Two fixes are for file answers that do not go out. See Security.
  • Easy to update. Run dart pub upgrade. Then check Read before you update.

Versions

Package New version
dox_core 3.2.9
dox_http_native 3.2.8
dox_postgres_native 3.2.4
dox_mysql_native 3.2.4
App template v3.2.9

The app template only gets the new minimum versions.

No change: all the other packages.

How to update

  1. Get the new versions:

    dart pub upgrade
    
  2. Build or start the app again. The new native libraries download automatically.

  3. Read Read before you update.

There is no API change. You do not need to run build_runner again.

Benchmark

We ran the same app on the 3.2.8 packages from pub.dev and on this release. The rig is Linux in Docker on an Apple M2 laptop, with 2 server cores. wrk has 4 cores. Each case runs for 10 seconds on HTTP/1.1. Each number is the median of 3 rounds.

A 4 KB file: 4.2 times more requests

A static file of 4 KB with 256 connections.

req/s p99 RAM
Doxthis release 98.7K4.2x faster 6.2 ms 48 MiB
Dox3.2.8 23.4Kbefore 16.9 ms 70 MiB

2 server cores · Linux in Docker on an Apple M2 · median of 3 rounds

A 1 MB file: 5.1 times more requests, 85% less memory

A static file of 1 MB with 64 connections.

req/s p99 RAM
Doxthis release 9.9K5.1x faster 12.9 ms 78 MiB
Dox3.2.8 1.9Kbefore 52.7 ms 518 MiB

2 server cores · Linux in Docker on an Apple M2 · median of 3 rounds

Case 3.2.8 This release p99 Peak memory
Static 4 KB file, 256 connections 23.4K 98.7K 16.9 → 6.2 ms 70 → 48 MiB
Static 1 MB file, 64 connections 1.9K 9.9K 52.7 → 12.9 ms 518 → 78 MiB
GET /json, 256 connections 246.9K 255.5K 2.37 → 1.84 ms 11 → 11 MiB

The second and third columns are requests a second. The peak memory is the peak of the container up to that case.

What the numbers do not show

  • Routes with no file are the same as before. GET /json moves by 3%. This is in the noise of the rig.
  • GET / looked 4% lower in one run. We did a second check with the CPU time for each request and a perf profile on 4 cores. The result was 537K and 539K requests a second, with the same CPU split. Thus the 4% was machine noise.
  • A small file can wait longer behind big downloads from a slow disk. In a slow-disk test, the p99 of a small file was 81 ms. Before, it was 31 ms.
  • This is one machine. Your numbers will be different.

Why static files are faster

No file byte goes through Dart

Before, Dart read each part of a file and gave it to the native server. Each part made a copy and work for the garbage collector.

Now the native server opens the file, reads it and sends it, all in Rust. This applies to Route.staticFiles and to a File that a controller returns. The open also gives the size and the change time of the file, so Dart does no stat call.

Range, ETag, 304 and the bytes of a response with a file do not change.

The server reads a file only when the connection can take it

The server reads a part of a file when the connection has room for it. A client that reads slowly does not make the server keep the file in memory.

On the HttpArena static test, the peak memory goes from approximately 1.5 GiB to 128 MiB. That test has 20 files, 256 HTTP/2 connections with 32 requests each, and 2 server cores.

A file pool reads from the disk

The thread of an isolate reads only the file bytes that the OS has in memory. A small set of threads, the file pool, reads all other files. Thus a slow disk does not stop the other requests.

An app that has all its files in memory starts no thread.

New

Precompressed files

Set precompressed: true to send a file that your build already compressed:

Route.staticFiles('/assets', 'public/assets', precompressed: true);
  • For a request for app.js, Dox looks for app.js.br (brotli) and app.js.gz (gzip) in the same folder.
  • Dox sends one of these files only if the client accepts its coding in Accept-Encoding.
  • The coding with the higher q wins. Brotli wins when the two are equal.
  • Each file of the folder gets Vary: Accept-Encoding.
  • The ETag and Last-Modified come from the file that Dox sends. 304 and Range work on that file.
  • The default is false. A folder that does not set it works as before.

See Static files.

The number of file threads

AppConfig.fileThreads sets the maximum number of threads that read the files of one static folder from the disk:

lib/config/app.dart
AppConfig appConfig = AppConfig(
  fileThreads: 8,
  // ...
);
  • The value is from 1 to 64. The default is 4.
  • All files of controllers are one more folder.
  • All isolates share these threads.
  • The server does not start with a value out of this range.
  • This setting is for the native server only.

See App config.

For package authors

dox_http_native has three new parts:

  • NativeFile.open(paths) opens a file and gives its size and its change time.
  • NativeResponse.addOpened(file, start: 0, length: n) sends a file that is already open.
  • NativeResponse.addFile(path, start: 0, length: n) opens a file and sends a part of it as the body.

Faster TLS under a burst of new connections

The first step of a TLS handshake signs with the private key. For an RSA 2048 key, this takes approximately 1 ms of CPU. Before, a burst of new connections did all of these steps in one call of the server loop. The first requests waited for the whole burst.

Now one call does a maximum of 16 of these steps. On the HttpArena JSON TLS test with 4,096 connections and 2 server cores, the p99 goes from 1.1-1.4 s to 94-112 ms. Plain HTTP does not change.

Security

  • Static folders on Windows. Route.staticFiles now refuses a path segment with ~ or :. Before, /ENV~1 (the 8.3 short name of .env) could send a dot file of the folder. A path such as a:b could read an alternate data stream. Other systems do not change.
  • Memory maps on Linux. File answers that never go out could use all the memory maps of the process. Then each new map failed, also for the Dart heap. Now the process keeps a maximum of 4,096 of these maps.
  • Stalled connections. A few connections that did not read could make all file reads small for all clients. Now only the first 4 file answers in line on a connection keep their preloaded bytes.
  • ctutils 0.4.4 in the Postgres driver (RUSTSEC-2026-0385). The old version did not compare in constant time. The driver uses it only through the SCRAM login. The risk was low.
  • url 2.5.9 in the MySQL driver (RUSTSEC-2026-0592). The old version could overflow the stack in Url::origin(). The driver does not call origin(), so an attacker could not get to this code.

Fixes

  • autoCompress and a 206 answer. A 206 answer, or an answer with a content-range header, was gzipped. The header gives the positions of the bytes before gzip, so the client got wrong data. Now these answers are not gzipped.
  • Memory under a very high load. With thousands of streamed answers in flight, messages from the native server to Dart waited behind the new requests. The memory grew without a limit. Now requests and messages take turns, and the memory stays flat.

Read before you update

  • dox_core 3.2.9 needs dox_http_native 3.2.8. dart pub upgrade gets them together.
  • A controller File in a folder that the app can not open now gives a 500. Before, it gave a 404.
  • The ABI version of dox_http_native is 12. This is important only if you use a git checkout of the native package. Run cargo build --release in native/. An app that gets the package from pub.dev needs no step.

Full list: the CHANGELOG of each package.