Files
RustProxy/docs/TRANSFORM.md
T
2026-10-09 13:11:33 +02:00

56 lines
2.6 KiB
Markdown

# Static-response transformation
RustProxy 0.22.3 retains static transformation between origin decoding and shared-cache
storage. A transformed identity representation is cached once and downstream compression
is selected later for each client. Per-vhost and Docker-discovery transform opt-in remain
disabled by default even when the global engine is available.
## Web Server origins (0.29.4)
Static-file and PHP-FPM responses selected through Web Server vhost sources
use the same optional vhost transform stage as reverse-proxy backends.
The normal rules still apply: supported MIME/extension and response encoding,
known bounded body size, memory/concurrency limits, and `no-transform`
exclusions. Successful transformed representations are eligible for shared
cache storage under the original/derived cache privacy policy. Downstream
compression is still applied separately.
## Administration dashboard
The main **Transform** workspace reads `GET /api/transform` and exposes in-memory runtime
statistics globally or per vhost:
- responses examined, transformed, skipped/fail-open and failed;
- transformed cache HITs (served without running the transformer again);
- original, transformed and saved bytes before client compression;
- average transform time;
- applied transforms by JavaScript/CSS/HTML/SVG/JSON;
- bounded skip/fail-open reason counters;
- current process-wide temporary-memory reservation versus the configured budget;
- current active transform slots versus the configured concurrency limit;
- a per-vhost effectiveness table.
Counters reset on process restart. They are diagnostic telemetry, not persisted cache
metadata. Resource usage is process-wide even when a vhost counter scope is selected. The
reservation is the transform limiter's conservative buffer estimate, not a second RSS
measurement. The Cache workspace separately marks stored transformed objects.
## Cache diagnostics
When `cache.expose_cache_status=true`, transformed cached representations are identified
with the RFC 9211 field plus an extension parameter:
```http
Cache-Status: RustProxy; hit; ttl=556488; detail="cache_hit"; transformed
```
The field remains `Cache-Status`, not `X-Cache-Status`. HTTP/2 and HTTP/3 normalize field
names to lowercase on the wire. Origin-provided `Cache-Status` and `X-Cache-Status` values
are removed before RustProxy emits its own diagnostics.
## Release status
The dashboard/telemetry does not change the existing v0.22.3 release gate. JavaScript and
CSS still require mature parser-backed minifiers, and the complete Rust compiler/runtime
acceptance gate must pass before release acceptance.