Skip to content

Clear Cache

POST
/api/system/cache/clear

Clear cache entries (cache module removed - no-op).

CacheClearRequest

Request model for cache clear operation.

Used for clearing all cache entries from global or service-specific cache. Useful for debugging, testing, forcing cache refreshes, and clearing stale data.

Fields:

  • service_name: Service cache to clear, None for global cache (optional, string | None)

Usage: POST /api/system/cache/clear accepts this request model for clearing cache entries.

JSON Example:

{
  "serviceName": "etherforce"
}
object
serviceName
Any of:
string

Successful Response

CacheClearResponse

Response model for cache clear operation.

Provides confirmation of cache clearing operation with number of entries cleared. Used by both cache_routes and performance_routes for cache clearing operations.

Fields:

  • status: Operation status - “success” or “error” (required, string)
  • message: Result message (required, string)
  • cleared_items: List of cleared item identifiers (required, list[str])
  • timestamp: ISO timestamp of operation (required, string)
  • success: Whether clear operation succeeded (optional, boolean) - for backward compatibility
  • entries_cleared: Number of entries cleared (optional, integer) - for backward compatibility

Usage: POST /api/system/cache/clear returns this response model with clear operation results. POST /api/system/performance/clear-cache also uses this model.

JSON Example:

{
  "status": "success",
  "message": "Successfully cleared cache for service: etherforce",
  "clearedItems": ["cache_key_1", "cache_key_2"],
  "timestamp": "2025-02-01T10:30:00Z",
  "success": true,
  "entriesCleared": 234
}
object
status
required
Status

Operation status (success or error)

string
message
required
Message

Result message

string
clearedItems
required
Cleareditems

List of cleared item identifiers

Array<string>
timestamp
required
Timestamp

ISO timestamp of operation

string
success
Any of:
boolean
entriesCleared
Any of:
integer

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object