Skip to content
Download

maxAge

mach::CorsBuilder::maxAge

Configures the preflight cache duration.

Sets how long browsers may cache CORS preflight responses.

CorsBuilder& maxAge(std::chrono::seconds maxAge);

A reference to the current CorsBuilder instance.

Parameter Description
maxAge The preflight cache duration.

This method is not thread-safe and should only be called during CORS configuration.

cors.maxAge(std::chrono::minutes(10));