secure_token_token_cache_scope

The `secure_token_token_cache_scope` directive specifies the caching behavior of secure tokens generated for responses in NGINX.

Syntaxsecure_token_token_cache_scope value;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The secure_token_token_cache_scope directive is utilized within the Secure Token module of NGINX to define the caching parameters for tokens based on their scope. By configuring this directive within the contexts of http, server, or location, it allows administrators to control how tokens are cached, ensuring that they align with their security requirements and performance goals. The parameter accepts a single value, which can be configured to indicate the desired caching behavior, which plays a critical role in managing how long a token remains valid before needing regeneration.

When tokens are generated for secure content delivery, caching plays a significant role in both performance enhancement and security. This directive works closely with other token-related configurations to manage cache durations, aligning with token expiration and access control settings. For instance, if a secure token is intended to expire shortly after its creation, the caching behavior dictated by this directive can prevent the reuse of old tokens, which might be exploited if cached longer than needed. Furthermore, careful management of cache scope can also help reduce the load on backend servers by enabling caching where appropriate while ensuring that tokens remain secure and up-to-date.

Config Example

http {
    secure_token_token_cache_scope 15m;
}

Setting a too-long cache duration may lead to old tokens being reused, compromising security.

Ensure that this directive is applied in the correct context (http, server, location) for it to take effect.

← Back to all directives