Zillowe FoundationZillowe Documentation

Architecture

Deep dive into how ZLS compresses URLs.

Stateless Compression

ZLS avoids a database by encoding the entire URL into the link itself. This is achieved through a multi-step compression pipeline written in Zig.

Tiered Domain Encoding (Parties)

ZLS uses a three-tier priority system to allocate bits for domain names:

  • Tier 1 (1st Party): The top 32 search, shopping, and social sites (Google, Amazon, YouTube, GitHub, etc.) are mapped to tiny 5-bit IDs. This allows common root URLs to be compressed into as few as 2 characters.
  • Tier 2 (2nd Party): Over 3,400 common domains from our inherited dictionary are mapped to 12-bit IDs.
  • Tier 3 (3rd Party): Unknown sites fall back to a Dynamic Multi-Alphabet Encoding. The engine automatically selects the most efficient character set for each segment (e.g. 4 bits for numeric IDs, 5 bits for lowercase paths, 6 bits for alphanumeric, or 7 bits for full ASCII).

Static Path Tokenization

Common path segments (like /user/, /project/, /pages/) are mapped to 6-bit tokens. The engine uses a "longest-match" algorithm to find the most efficient tokens for any given path.

URL Normalization

  • Protocols are mapped to a 1-bit value (https vs http).
  • Redundant www. prefixes are stripped and stored as 1-bit.
  • TLDs (.com, .org, etc.) are mapped to a 4-bit lookup table.
  • Trailing Slashes are aggressively trimmed to ensure consistent, shorter payloads.

BigInt Bit-Packing

The core engine treats the data stream as a single, giant BigInt. By using arbitrary-precision arithmetic, we can pack bits of variable length continuously without worrying about byte-alignment overhead.

Bijective Base84 Encoding

The resulting BigInt is converted to a custom Bijective Base84 character set designed for URL safety. This maximize the data density per character compared to standard Base64 and eliminates the "leading zero" problem of standard base conversion.

Client-Side Decompression

Because the payload is stored in the URL fragment (#), it is never sent to the server. The browser's WASM engine handles the decompression and window.location.replace() for a fast, private redirect.


A software organization

2026 © All Rights Reserved.

  • All the content is available under CC BY-SA 4.0, expect where otherwise stated.

Last updated on