summaryrefslogtreecommitdiff
path: root/doc/resolver-caching.rst
blob: f39b8ad911469d435e502cef7a4f81f796491e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.. _resolver-caching:

Resolver Caching Classes
========================

The dnspython resolver does not cache by default, but caching can be
enabled by creating a cache and assigning it to the resolver's *cache*
attribute.  If a cache has been configured, the resolver caches both
positive and negative responses.  The cache respects the DNS TTL of
the data, and will not return expired entries.

Two thread-safe cache implementations are provided, a simple
dictionary-based Cache, and an LRUCache which provides cache size
control suitable for use in web crawlers.

.. autoclass:: dns.resolver.Cache
   :members:

.. autoclass:: dns.resolver.LRUCache
   :members: