Skip to content

Commit 99cc830

Browse files
committed
README update
1 parent 2e2899a commit 99cc830

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,20 @@ using DataCaches, PaleobiologDB
170170
# Optional: show caching operations in debug logs
171171
ENV["JULIA_DEBUG"] = "DataCaches"
172172

173-
# Here we use a siloed project specific cache.
174-
dc = DataCache(:myproject)
175-
set_active_autocache!(dc)
176-
177-
# If we did not run `set_active_autocache!` above,
178-
# the active autocache store will be used in all
179-
# the patterns below:
180-
# dc = DataCaches.active_autocache()
181-
182173
# --- Pattern 1: @filecache — works with any function, no setup beyond the cache ---
183174
occs = @filecache pbdb_occurrences(base_name = "Canidae", show = "full") # fetches + stores
184175
occs = @filecache pbdb_occurrences(base_name = "Canidae", show = "full") # from cache
185176

186177
# --- Pattern 2: explicit dict-style — full control over labels and timing ---
178+
# Here we use a siloed project specific cache.
179+
dc = DataCache(:myproject)
187180
dc["canidae_occs"] = pbdb_occurrences(base_name = "Canidae", show = "full")
188181
occs = dc["canidae_occs"]
189182

190183
# --- Pattern 3: set_autocaching! — zero call-site changes, but requires
191184
# instrumented or wrapped functions (see Pattern 3 section below) ---
192-
set_autocaching!(true; cache = dc)
185+
set_autocaching!(true)
186+
# can also do: set_autocaching!(true; cache = DataCache(:myproject))
193187
occs = pbdb_occurrences(base_name = "Canidae", show = "full") # fetches + stores
194188
occs = pbdb_occurrences(base_name = "Canidae", show = "full") # from cache, unchanged call
195189
set_autocaching!(false)

0 commit comments

Comments
 (0)