diff --git a/README.md b/README.md index 47c6bf6..fa98388 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ Built on Rust, on top of **Cloudflare’s Pingora engine**, **Aralez** delivers | **file_server_folder** | /some/local/folder | Optional. Local folder to serve | | **file_server_address** | 127.0.0.1:3002 | Optional. Local address for file server | | **config_api_enabled** | true | Enable/disable remote config push capability | +| **cache_size_mb** | 50 | Optional. Enable internal cache with size in megabytes of value. Cache is entirely disabled when this line is commented out. | +| **cache_ttl** | 10 | Optional. Set Default TTL in seconds for cached items, works if cache control headers are not set via upstream. Defaults to 60 if cache_size_mb is set. | --- diff --git a/src/web/proxyhttp.rs b/src/web/proxyhttp.rs index 76eb7a0..e414286 100644 --- a/src/web/proxyhttp.rs +++ b/src/web/proxyhttp.rs @@ -76,7 +76,7 @@ impl ProxyHttp for LB { let cc = CacheControl::from_resp_headers(resp); let defaults = CacheMetaDefaults::new( |status| { - if status.as_u16() == 200 { + if status == StatusCode::OK { Some(Duration::from_secs(*CACHE_TTL.get().unwrap_or(&60))) } else { None