Skip to content

Conversation

@flrdv
Copy link
Member

@flrdv flrdv commented Aug 29, 2025

First release-candidate for v0.17.3. It introduces better codecs system, reworked streams and many other QoL features. The next release candidate (likely to be chosen for the release) is planned to mostly consist of bugfixes and improved test coverage.

Changes:

  • reworked codecs: now their buffers are allocated on-demand and are of size of net read buffer. Added a base codec entity, which eases an introduction of new codecs considerably.
  • added deflate and zstd codecs.
  • made App.Codec() variadic in order to support the new codec.Suit(), thereby making it possible to register all out-of-the-box available codecs all at once.
  • added automatic compression. Prior Compress(string) method is now Compression(string), the new Compress() decides automatically, whether the body will or will not be compressed. All bodies exceeding Config.NET.SmallBody limit (4096 by default) are avoided from being compressed. The codec to be used is chosen based on client preferences, respecting q-values and/or (otherwise) the order.
  • fixed HTTP/1.0 compatibility. For HTTP/1.0 requests, unsized streams are written as plain bodies and are terminated by closing the connection.
  • added middleware.Autocompress middleware. Handy to specify it for the static content distribution.
  • removed http.Request.Encoding struct. All its prior attributes are now embedded directly into the request entity.
  • implemented Len() int interface for http.Request.Body. This enables plain-body echo for non-chunked requests. Is a real-real transparent echo now!
  • reworked streams. Merged http.Response.SizedStream(io.Reader, int64) into http.Response.Stream(io.Reader). The size hint is now optional, and if not set, the reader is additionally examined for compatibility with the Len() int interface.
  • added streams buffering. In order to increase the performance by minimizing the number of writes, serializer can write multiple times into the buffer if it is empty enough. This aims primarily at codecs, as those are producing many small writes.
  • added server-wide OPTIONS.
  • improved TRACE support considerably, but disabled it by default. It can be enabled back via the inbuilt.Router.EnableTRACE(true) flag.
  • urlencoded slashes aren't automatically decoded anymore. To route them, the slash in the endpoint path must also be urlencoded.
  • to register an endpoint with a colon character, you can simply put it as a urlencoded char (%3a).
  • Transfer-Encoding: identity is now ignored.
  • greatly improved the dynamic routing (radix tree) performance by using binary search for predecessors instead of linear.
  • other minor performance improvements.

flrdv added 30 commits August 12, 2025 02:08
…checking for Len() int compatibility to automatically determine the size
…cally in runtime rather than being a hardcoded const
… (less than NET.SmallBody bytes) avoid being compressed automatically
@flrdv flrdv self-assigned this Aug 29, 2025
@flrdv flrdv added documentation Improvements or additions to documentation enhancement New feature or request bugfix pull request that only fixes some bugs labels Aug 29, 2025
@flrdv flrdv merged commit 2469413 into indigo-web:master Aug 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request that only fixes some bugs documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant