URLUse this to clear cache
https://serve.faux-api.com/tokenNo/cache_clear

Cache management

Our system is built with a "Set and Forget" philosophy. We employ an intelligent invalidation layer that monitors your project’s state and refreshes data in real-time.

🔄 Automatic Cache Management

By default, the system tracks changes to your project. The cache is automatically purged when the following events are detected:

  • Mock Data Updates: Changes to any JSON or database entries.

  • Schema Modifications: Altering field types or adding/removing keys.

  • Relationship Changes: Updates to how entities (e.g., Users to Posts) connect.

  • Response Structuring: Changes to the final output format of an endpoint.

Cache Expiry (TTL)

Cache data in Faux API is not stored permanently.

Each cached API response automatically expires after 30 days

What This Means

After 30 days:

  • Cache is automatically cleared

  • Fresh data is generated on the next request

  • No manual action is required

How to Check if Cache Is Working

You can easily check cache status using the response header returned by the API.

Check Response Header: x-faux-cache

Example API Response Headers:

x-faux-cache: HIT

✔ Cache is working

✔ Data served from cache

x-faux-cache: MISS

✔ Cache is not available

✔ New data was generated

🛠 Manual Cache Purge

Manual cache purge is provided only for exceptional situations where an immediate refresh is needed.

Use manual cache purge when:

  • You still see old responses after updating data

  • All cached URLs under the project need to be cleared

  • A specific API endpoint is not refreshing

  • You want to instantly remove cache for selected API URLs

  • You need a forced cache reset for production environments

Manual purge allows precise cache control without impacting unrelated APIs.

If you want to clear cache for specific URLs

{
  "email": "user@example.com",
  "purge": {
    "type": "urls",
    "values": [
      "apiName_1",
      "apiName_2"
    ]
  }
}

If you want to clear all cache for the entire project

{
  "email": "user@example.com",
  "purge": {
    "type": "all",
    "values": []
  }
}
  fetch('https://serve.faux-api.com/tokenNo/cache_clear', { 
  method: 'POST',
  headers: {
  'Content-Type': 'application/json',
  // Include Authorization headers if required
  'Authorization': 'Bearer YOUR_TOKEN_HERE',
  },
  body: JSON.stringify(data)
  });

Here is the response

{
  {
  "success": true,
  "result": {
    "message": "Selected API cache removed successfully",
    "purged_apiNames": [
      "apiName_1",
      "apiName_2"
    ],
    "cleared_at": "2026-02-22T15:10:00Z"
  }
}
}

Conclusion

Cache management in Faux API is designed to be simple, reliable, and efficient.

In most cases, the system automatically handles cache updates as your project evolves, ensuring that API responses stay fresh without any manual effort.

For situations that require immediate control, manual cache clearing is available. You can either clear cache for specific API URLs to minimize impact or clear the entire project cache when a full reset is necessary, such as during production updates or critical changes.

By combining intelligent automatic caching with flexible manual controls, Faux API ensures high performance while giving you full confidence that your APIs always return the latest data.