v0.38.7
This commit is contained in:
1 parent
d4a604970e
commit
38a23e2210
40 files changed
+928
-532
No files matched your search
+12
-2
@@ -5,7 +5,17 @@ RustProxy provides an optional shared HTTP response cache with a bounded in-memo
|
||||
### Cache controls in Settings
|
||||
|
||||
The **Rules** subtab holds the conditional cache rules described in [Cache rules (VCL-style)](#cache-rules-vcl-style).
|
||||
The static-extension cookie-bypass warning sits with its extension list, separate from **Cache response headers** options. Only enable this optimization for files whose bytes do not depend on the user's session. `Cookie` can then be omitted from the shared cache key for the configured extensions; responses with `Set-Cookie`, `private`, `no-store` or `Vary: Cookie` remain uncacheable.
|
||||
The **Static & diagnostics** subtab provides **Ignore request cookies for static files** (`cache.static_ignore_cookies`, on by default) and **Ignore Vary: Cookie for public static assets** (`cache.static_ignore_vary_cookie`, on by default), plus the allowed extensions (`cache.static_extensions`). Both options are effective only on the configured file extensions and work together: the request Cookie is excluded from the cache key, and a qualifying backend `Vary: Cookie` is removed from the stored and delivered response. Other Vary dimensions (such as `Accept-Language` or `Accept-Encoding`) remain intact. A vhost may override either option independently, or inherit the global values.
|
||||
|
||||
**Safety requirement:** use both options only when the complete static response (body **and headers**) is identical for all visitors regardless of Cookie. `Vary: Cookie` is a declaration that content may vary, so overriding it on a genuinely session-dependent file can expose one user's cached variant to another. RustProxy applies this override only to responses with an explicit `Cache-Control: public` directive, positive remaining freshness (without mandatory revalidation) and no `Set-Cookie`, `private`, `no-store` or invalid Vary. A zero-TTL response, including `public` with no configured fallback TTL, retains `Vary: Cookie` even if it can be stored for later revalidation. If the response is not cacheable, `Vary: Cookie` is passed through unchanged. Do not enable this optimization for user-specific downloads, generated PDFs, account JSON, or any path where Flask or another origin changes content according to a session cookie; prefer removing the needless `Vary: Cookie` at the origin where possible.
|
||||
|
||||
## `Vary` matching (RFC 9111 §4.1)
|
||||
|
||||
Cached variants use the response's `Vary` field names together with the original request's nominated fields. Reuse requires a match in **every** retained `Vary` dimension; `Vary: *` is never reusable. An absent request field is not equivalent to a present but empty field.
|
||||
|
||||
To avoid unnecessary variants, RustProxy normalizes optional whitespace around commas, joins repeated header lines **only** for known comma-list fields, and preserves quoted strings. For valid `Accept-Language`, `Accept-Encoding` and `Accept-Charset` values it also normalizes case-insensitive tokens and equivalent `q` weights (`q=1` and an omitted weight are equivalent). `Accept` media type/subtype casing is normalized without changing case-sensitive parameter values. List order remains intact; values of `Cookie`, `User-Agent` and other opaque/custom fields are not parsed or reordered. Unsupported or malformed values fall back to conservative bytewise matching (aside from outer HTTP whitespace). This is **deliberately limited semantic normalization**, not a promise to reinterpret every possible extension header.
|
||||
|
||||
The corrected key algorithm uses a new internal variant-key domain. On upgrading an existing installation to the updated **0.38.7** sources, previously persisted COLD variants keyed by the older algorithm will miss and be repopulated; unvaried cached responses do not change. These cold misses are intentional to avoid unsafe cross-version reuse. No configuration changes or cache clearing are required.
|
||||
|
||||
## Enable caching safely
|
||||
|
||||
@@ -77,7 +87,7 @@ In **Vhosts → Cache**, overrides for static extensions, bypass path prefixes a
|
||||
|
||||
- Reuse is scoped by frontend scheme, Host, exact client URL, Vhost/content policy and eligible `Vary` dimensions. HTTP and HTTPS objects do not cross-share.
|
||||
- GET and suitable HEAD requests may reuse a full object; changing request methods do not silently invalidate all cached GET results.
|
||||
- Authorization, dynamic cookies, `Set-Cookie`, sticky-affinity cookies, Tinyauth and other private signals normally cause **BYPASS**. A limited static-file cookie exception exists for configured static extensions and does not override `private`, `no-store`, `Set-Cookie` or `Vary: Cookie`.
|
||||
- Authorization, dynamic cookies, `Set-Cookie`, sticky-affinity cookies, Tinyauth and other private signals normally cause **BYPASS**. The static-extension exception may ignore `Vary: Cookie` only if the explicitly public response is otherwise safe to store and the global/vhost option is on. It never overrides `private`, `no-store` or `Set-Cookie`; the origin must guarantee that the complete asset response is not session-dependent.
|
||||
- Origin status, response size, TTL, unsupported metadata, range/conditional semantics and request/client cache directives can prevent fill or require validation.
|
||||
- A Web Service selected as a Vhost source uses the same cache policy for eligible local files. File changes can be checked with `ETag` / `Last-Modified`; a 304 validation may refresh a stored body without downloading it again.
|
||||
|
||||
|
||||
Reference in new issue
Block a user