requestCache

fun requestCache(requestCacheConfiguration: RequestCacheDsl.() -> Unit)

Enables request caching. Specifically this ensures that requests that are saved (i.e. after authentication is required) are later replayed.

Example:

@Configuration
@EnableWebSecurity
class SecurityConfig {

@Bean
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
http {
requestCache { }
}
return http.build()
}
}

Parameters

requestCacheConfiguration

custom configuration to apply to the request cache

See also