Skip to content

Commit 140231f

Browse files
committed
More documentation on setting cache size.
1 parent 8c88a9d commit 140231f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ resources. Clients may also consider using [RestClient Components][] to enable
3939
client-side caching of HTTP results using [Rack::Cache][] or other Rack
4040
middleware.
4141

42+
See {RDF::Util::File} for configuring other mechanisms for retrieving resources.
43+
44+
### Term caching and configuration.
45+
46+
RDF.rb uses a weak-reference cache for storing internalized versions of URIs and Nodes. This is particularly useful for Nodes as two nodes are equivalent only if they're the same node.
47+
48+
By default, each cache can grow to an unlimited size, but this can be configured using {RDF.config}, for general limits, along with URI- or Node-specific limits.
49+
50+
For example, to limit the size of the URI intern cache only:
51+
52+
RDF.config.uri_cache_size = 10_000
53+
54+
The default for creating new caches without a specific initialization size can be set using:
55+
56+
RDF.config.cache_size = 100_000
57+
4258
## Differences between RDF 1.0 and RDF 1.1
4359

4460
This version of RDF.rb is fully compatible with [RDF 1.1][], but it creates some

0 commit comments

Comments
 (0)