Recipe
This recipe shows how to usepersistentStore (TypeScript) or persistent_store (Python) to cache scraped data across executions of the same project.
TypeScript
How it works
- Check the cache — Use
persistentStore.get()/persistent_store.get()to look for existing data. - Return cached data — If found, return immediately without re-scraping.
- Scrape and store — On cache miss, navigate to the page, extract data, and store it with
persistentStore.set()/persistent_store.set()for future runs.
Related SDK methods
persistentStore (TypeScript)
TypeScript SDK helper for persistent key-value storage
persistent_store (Python)
Python SDK helper for persistent key-value storage