Removes every entry. Which of two things happens underneath depends on whether the cache settings have changed since the store was built:
Details
- Settings unchanged
The existing store is cleared in place, so a reference taken from
cache()earlier stays valid and keeps pointing at the live cache. This is the ordinary case.- Settings changed
The store is dropped so the next
cache()builds one from the new settings. Tests rely on this after pointingBIOHTTP_CACHE_DIRat a fresh tempdir or togglingBIOHTTP_CACHE_DISK.
The in-place branch exists because dropping unconditionally silently orphans any held reference: writes through it go somewhere nothing else can see, and the only symptom is a hit rate quietly falling to zero. A reference held across a genuine settings change is still orphaned, but nothing changes cache settings mid-run except a test suite, and those do not hold references.