Cache Revalidation
Learn how to force fresh scrapes and bypass cache when needed.
Premium FeatureWhat is Cache Revalidation?
Cache revalidation allows you to force the API to perform a fresh scrape of a URL, bypassing any existing cache entries. This is useful when you know the content has changed and you need the latest data immediately.
Premium Feature
Cache revalidation is only available for Premium tier users. Free tier users must wait for the cache to expire naturally (1 day).
How It Works
Revalidation Process
- Add
revalidate=trueto your request - API checks for existing cache entry
- If found, the cache entry is deleted
- A fresh scrape is performed
- New data is cached with the configured cache duration
- Fresh data is returned in the response
Usage Examples
Add revalidate=true as a query parameter to force a fresh scrape.
Loading code...
Response Indicators
Cache Status Headers
When revalidating, the response will include:
X-Cache: MISS- Indicates a fresh scrape was performedX-Cache-Expires-At- New expiration timestampcached: false- In the JSON response body
When to Use Revalidation
✅ Good Use Cases
- • Content was recently updated
- • Testing changes to a website
- • Debugging scraping issues
- • One-time fresh data fetch
❌ Avoid Overuse
- • Don't revalidate on every request
- • Cache is there to save costs
- • Only revalidate when necessary
- • Consider cache duration instead
Best Practices
Revalidation Tips
- • Use revalidation sparingly to avoid unnecessary API calls
- • Consider adjusting cache duration instead of frequent revalidation
- • Implement user-triggered revalidation for admin interfaces
- • Monitor your API usage when using revalidation
- • Combine with custom cacheTime for optimal control
PageSight