document early_request_filter

Fix #363
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
spacewander 2024-08-31 01:38:05 +08:00
parent 1b9e8eead1
commit 34c67f0aca
2 changed files with 8 additions and 3 deletions

View file

@ -16,7 +16,8 @@ The pingora-proxy HTTP proxy framework supports highly programmable proxy behavi
Pingora-proxy allows users to insert arbitrary logic into the life of a request.
```mermaid
graph TD;
start("new request")-->request_filter;
start("new request")-->early_request_filter;
early_request_filter-->request_filter;
request_filter-->upstream_peer;
upstream_peer-->Connect{{IO: connect to upstream}};
@ -52,9 +53,12 @@ Pingora-proxy allows users to insert arbitrary logic into the life of a request.
* The reason both `upstream_response_*_filter()` and `response_*_filter()` exist is for HTTP caching integration reasons (still WIP).
### `request_filter()`
### `early_request_filter()`
This is the first phase of every request.
This function is similar to `request_filter()` but execute before any other logic especially the downstream modules.
### `request_filter()`
This phase is usually for validating request inputs, rate limiting, and initializing context.
### `proxy_upstream_filter()`

View file

@ -1,7 +1,8 @@
Pingora proxy phases without caching
```mermaid
graph TD;
start("new request")-->request_filter;
start("new request")-->early_request_filter;
early_request_filter-->request_filter;
request_filter-->upstream_peer;
upstream_peer-->Connect{{IO: connect to upstream}};