@@ -170,26 +170,20 @@ using DataCaches, PaleobiologDB
170170# Optional: show caching operations in debug logs
171171ENV [" 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 ---
183174occs = @filecache pbdb_occurrences (base_name = " Canidae" , show = " full" ) # fetches + stores
184175occs = @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 )
187180dc[" canidae_occs" ] = pbdb_occurrences (base_name = " Canidae" , show = " full" )
188181occs = 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))
193187occs = pbdb_occurrences (base_name = " Canidae" , show = " full" ) # fetches + stores
194188occs = pbdb_occurrences (base_name = " Canidae" , show = " full" ) # from cache, unchanged call
195189set_autocaching! (false )
0 commit comments