bot_verifier_redis_expiry

Sets the expiration time for bot verification cache entries in Redis.

Syntaxbot_verifier_redis_expiry ;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The bot_verifier_redis_expiry directive in the NGINX Search Index Bot Verification Module defines the duration for which cached verification results are valid before they expire. This expiration time is set in seconds and is essential for managing the lifecycle of cached entries in Redis, which the module uses to determine whether a requesting agent is a legitimate search engine bot or not. By caching the verification results, this directive helps reduce redundant checks on every request, improving performance and efficiency.

When the validation for a bot is performed and cached, the results are stored in Redis with an associated expiration time determined by the bot_verifier_redis_expiry directive. If the cached entry for a specific bot is still valid when a subsequent request is received, the module can quickly refer to the cached results rather than re-validating the request against external standards. If the cached entry has expired, NGINX will perform a new verification of the requesting IP address and update the cache with fresh results. This behavior allows flexibility to adjust the expiry time according to the needs of the application, potentially balancing accuracy and load.

Config Example

location / {
    bot_verifier on;
    bot_verifier_redis_host localhost;
    bot_verifier_redis_port 6379;
    bot_verifier_redis_expiry 3600;
}

Setting the expiry too short may lead to frequent cache misses and increased verification load.

Setting the expiry too long may return stale verification results, allowing invalid bots access longer than intended.

← Back to all directives