grpc_ssl_certificate_cache

The grpc_ssl_certificate_cache directive configures the caching behavior for SSL certificates used in gRPC communications, optimizing performance.

Syntaxgrpc_ssl_certificate_cache size [max_size] [ttl];
Defaultnone
Contexthttp, server, location
Arguments1-3

Description

The grpc_ssl_certificate_cache directive in NGINX is designed to enhance the efficiency of gRPC communications by caching SSL certificates. It allows administrators to specify a cache mechanism for storing SSL certificates that are frequently used in gRPC connections, reducing the need for repeated loading and parsing of these certificates. This can significantly improve latency and performance by minimizing the overhead involved in establishing secure connections repeatedly due to caching.

This directive can accept 1 to 3 parameters: the size of the cache, the TTL (Time To Live) for the cached certificates, and an optional maximum size. The first parameter sets the cache size, typically expressed in bytes (e.g., 10m for 10 megabytes). The TTL determines how long the certificates remain valid in the cache before they are removed and reloaded. Administrators can adjust these parameters based on their specific server load and performance requirements. The directive's flexibility allows for configurations that fit various gRPC application needs, ensuring secure and efficient service delivery.

Config Example

grpc_ssl_certificate_cache 10m 2m 1h;

Ensure the cache size is appropriate for the certificate sizes your application needs.

Watch out for the TTL; setting it too short may lead to performance issues due to frequent reloads of certificates.

Verify permissions on the cache directory if caching fails.

← Back to all directives