Skip to main content

CACHE_CAPACITY

Constant CACHE_CAPACITY 

Source
pub const CACHE_CAPACITY: usize = 512;
Expand description

How many distinct client_ids MemoryClientMetadataCache holds at once.

POST /oauth/par is unauthenticated and the client_id it names is the caller’s to choose, so every distinct string a caller invents is a cacheable entry. Without a bound that map only ever grows, which is a way to spend this server’s memory while holding no credential. Past it the cache drops what it has held longest, so a spree of invented ids costs a re-fetch for the real clients rather than the process.