@@ -93,10 +93,9 @@ composing :class:`~ua_parser.Resolver` objects.
9393The most basic such customisation is simply configuring caching away
9494from the default setup.
9595
96- As an example, in the default configuration if |regex |_ is available
97- the regex-based resolver is not cached, a user might consider the
98- memory investment worth it and want to reconfigure the stack for a
99- cached base.
96+ As an example, all resolvers are cached with an
97+ :class: `~ua_parser.caching.S3Fifo ` of size 2000, a user's workload
98+ might lead them to favor a larger LRU.
10099
101100The process is uncomplicated as the APIs are designed to compose
102101together.
@@ -112,7 +111,7 @@ the relevant :class:`Matchers` data::
112111The next step is to instantiate the cache [#cache ]_ suitably
113112configured::
114113
115- cache = ua_parser.Cache(1000 )
114+ cache = ua_parser.caching.Lru(10000 )
116115
117116And compose the base resolver and cache together::
118117
@@ -136,6 +135,11 @@ from here on::
136135 :class: `~ua_parser.caching.Local `, which is also caching-related,
137136 and serves to use thread-local caches rather than a shared cache.
138137
138+ Although this does not remove the cache locks it avoids contention
139+ on the locks, which can be useful when using a free-threaded
140+ interpreter, especially when using the LRU cache as it has to
141+ synchronise on hit.
142+
139143.. _builtin-resolvers :
140144
141145Builtin Resolvers
0 commit comments