---
name: "Zonemaster::Engine::Nameserver::Cache::RedisCache"
section: "3pm"
platform: "linux"
package: "libzonemaster-perl"
version: "7.1.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Zonemaster::Engine::Nameserver::Cache::RedisCache"
---

# Zonemaster::Engine::Nameserver::Cache::RedisCache(3pm)

global shared caches for nameserver objects

## NAME

Zonemaster::Engine::Nameserver::Cache::RedisCache - global shared caches for nameserver objects

## SYNOPSIS

```
    This is a global caching layer.
```

## ATTRIBUTES

Subclass of Zonemaster::Engine::Nameserver::Cache.

## CLASS METHODS

- new

  Construct a new Cache object.

- set\_key($idx, $packet)

  Store `$packet` with key `$idx`.

- get\_key($idx)

  Retrieve `$packet` (data) at key `$idx`.

Cache time is the shortest time of TTL in the DNS packet and cache.redis.expire in the profile. Default value of cache.redis.expire is 300 seconds.

If there is no TTL value to be used in the DNS packet (e.g. SERVFAIL or no response), then cache time is fixed to 1200 seconds instead.
