erldns_packet_cache (erldns v7.0.0-rc10)
View SourceA basic packet cache that is used to avoid multiple lookups for the same question received within the cache TTL.
In order to work correctly, it should be added to the packet pipeline twice, once early in the processing pipeline, and once after the resolver.
Configuration
{erldns, [
{packet_cache, #{
enabled => boolean(), %% defaults to true
ttl => non_neg_integer(), %% Seconds, defaults to 30
}}
]}
Telemetry events
[erldns, pipeline, cache]
spans as triggered bysegmented_cache
.
Summary
Functions
-spec call(dns:message(), erldns_pipeline:opts()) -> erldns_pipeline:return().
erldns_pipeline:call/2
callback.
-spec clear() -> any().
Clear the cache
-spec prepare(erldns_pipeline:opts()) -> disabled | erldns_pipeline:opts().
erldns_pipeline:prepare/1
callback.