Cache Revalidation

Learn how to force fresh scrapes and bypass cache when needed.

Premium Feature

What 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.

How It Works

Revalidation Process
  1. Add revalidate=true to your request
  2. API checks for existing cache entry
  3. If found, the cache entry is deleted
  4. A fresh scrape is performed
  5. New data is cached with the configured cache duration
  6. 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 performed
  • X-Cache-Expires-At - New expiration timestamp
  • cached: 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 | PageSight