Skip to main content

RendererConfig

Struct RendererConfig 

Source
pub struct RendererConfig {
Show 20 fields pub mode: RendererMode, pub page_timeout_ms: u64, pub http_timeout_ms: Option<u64>, pub lightpanda_timeout_ms: Option<u64>, pub chrome_timeout_ms: Option<u64>, pub pool_size: usize, pub render_js_default: Option<bool>, pub lightpanda: Option<CdpEndpoint>, pub playwright: Option<CdpEndpoint>, pub chrome: Option<CdpEndpoint>, pub chrome_intercept_resources: bool, pub chrome_intercept_stylesheets: bool, pub chrome_host_intercept_disable: Vec<String>, pub chrome_nav_budget_ms: u64, pub chrome_context_pool_enabled: bool, pub chrome_pool: ChromePoolConfig, pub chrome_backend: ChromeBackend, pub use_predictor: bool, pub escalation: EscalationConfig, pub antibot: AntibotConfig,
}

Fields§

§mode: RendererMode§page_timeout_ms: u64

Generic per-page navigation timeout. Used as the fallback when no per-tier override is configured. Kept for backward compatibility — the per-tier knobs below are preferred for new deployments.

§http_timeout_ms: Option<u64>

Override for the HTTP-only fetcher request timeout. Falls back to page_timeout_ms when unset. HTTP responses arrive quickly when they arrive at all, so 15s is generous and keeps slow upstreams from hogging the request budget that should be spent on JS retries.

§lightpanda_timeout_ms: Option<u64>

Override for the LightPanda CDP renderer. LightPanda completes most renders in <10s; if it stalls past 20s it almost always means an adversarial page that Chrome will render anyway, so failing fast and escalating beats waiting it out.

§chrome_timeout_ms: Option<u64>

Override for the full-Chromium tier. Chrome is the slow path (gov/legal SPAs need 30–40s for networkidle); the larger budget here recovers ~6 URLs per fc-wins iteration without affecting the fast path.

§pool_size: usize§render_js_default: Option<bool>

If set, applies to every request that doesn’t specify renderJs explicitly. Some(true) = force JS rendering; Some(false) = skip JS; None = auto-detect.

Accepts the force_js alias for backward compatibility.

§lightpanda: Option<CdpEndpoint>§playwright: Option<CdpEndpoint>§chrome: Option<CdpEndpoint>§chrome_intercept_resources: bool

Enable Chrome resource interception (Fetch.enable blocking of media, fonts, trackers). Default false; flipped after the CDP-fake suite validates pump + cleanup behaviour. See plan Phase 2.

§chrome_intercept_stylesheets: bool

Additionally block stylesheet requests when interception is enabled. Default false — kept off in v1 because some extractors depend on CSS-driven visibility / lazy-content triggers.

§chrome_host_intercept_disable: Vec<String>

Per-host opt-out for chrome interception. Hosts in this list run with interception disabled even when chrome_intercept_resources = true.

§chrome_nav_budget_ms: u64

Hard chrome-tier navigation budget in ms. Wraps wait_for_page_ready in an inner race; on budget hit the renderer snapshots whatever DOM is present and returns truncated = true. Calibrated as p90(successful chrome renders) clamped to [8_000, 12_000].

§chrome_context_pool_enabled: bool

Enable the bounded browser-context pool. Default false; v1 ships RECYCLE_AFTER_NAV = 1 (recreate every release) before optimising to reuse-with-clearing. See plan Phase 4. Gated off when chrome_backend = "browserless" — browserless v2’s Target.createBrowserContext semantics with long-lived sessions are unproven; lib.rs forces this to false with a WARN log in that case.

§chrome_pool: ChromePoolConfig

Per-knob pool configuration. Read only when chrome_context_pool_enabled = true AND backend is Vanilla.

§chrome_backend: ChromeBackend

Which Chrome backend the WS URL points at. Explicit — never sniff from URL substrings (k8s svc names, port-forwards, custom routes break substring detection per plan §C2). Default Vanilla.

§use_predictor: bool

Enable the success-ratio renderer predictor in HostPreferences. Default false; flipped after the predictor replay harness gates on the 1k bench (false-skip < 2 %, false-escalate < 5 %, churn < 3 / 1k).

§escalation: EscalationConfig

Engine escalation policy (firecrawl-shaped: race + on-error). When disabled (default), the renderer keeps its current ladder unchanged.

§antibot: AntibotConfig

Anti-bot detection policy (crawl4ai 3-tier classifier).

Implementations§

Source§

impl RendererConfig

Source

pub fn http_timeout(&self) -> u64

Resolved per-tier nav timeout in milliseconds. Resolution rules:

  1. If the explicit per-tier field is set, use it verbatim.
  2. Otherwise fall back to page_timeout_ms (which itself defaults to 30s for backward compatibility with pre-multi-tier configs).

New deployments are encouraged to set the per-tier knobs to 15/20/45s (see config.docker.toml) — these match the bench-tuned values that recover slow gov sites in the chrome tier without giving the http tier permission to hog the request budget.

Source

pub fn lightpanda_timeout(&self) -> u64

Source

pub fn chrome_timeout(&self) -> u64

Source

pub fn cdp_tier_count(&self) -> usize

Number of active CDP tiers (lightpanda + playwright + chrome) under the current mode. Mirrors the predicate used at runtime in crw-renderer/src/lib.rs when constructing the renderer ladder: want(mode) && config.<tier>.is_some().

Returns 0 when the binary is built without the cdp feature — in that case no JS renderer can be constructed regardless of the config, so the deadline auto-extension policy must collapse to HTTP-only.

Source

pub fn min_deadline_for_full_ladder_ms(&self) -> u64

Minimum request deadline budget (ms) required so that every configured tier can use its full allowance when fallback exhausts the chain. Sums the per-tier timeouts and adds CDP_TIER_OVERHEAD_MS for each active CDP tier, matching the runtime ladder built in crw-renderer/src/lib.rs.

Trait Implementations§

Source§

impl Clone for RendererConfig

Source§

fn clone(&self) -> RendererConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RendererConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RendererConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RendererConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,