Pattern'e Göre Cache Temizle
Pattern'e göre cache'leri temizler.
Endpoint
POST /api/v1/cache/clear-pattern
Authentication
Bu endpoint authentication gerektirir.
Header: Authorization: Bearer \{token\}
Permission
cache.clear- Cache temizleme
Request
Headers
| Header | Değer | Zorunlu |
|---|---|---|
Authorization | Bearer \{token\} | Evet |
Content-Type | application/json | Evet |
Request Body
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
pattern | string | Evet | Cache pattern'i (wildcard: *) |
Example Request
{
"pattern": "exchange_rate_*"
}
Response
Success Response (200 OK)
{
"message": "Cache cleared successfully",
"pattern": "exchange_rate_*",
"cleared_count": 25
}
Error Responses
400 Bad Request
{
"message": "Pattern-based clearing is only supported for database driver. Use specific clear methods instead.",
"pattern": "exchange_rate_*"
}
403 Forbidden
{
"message": "Forbidden"
}
Code Examples
cURL
curl -X POST https://api.example.com/api/v1/cache/clear-pattern \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"pattern": "exchange_rate_*"
}'
Notes
- Pattern-based clearing sadece database driver için desteklenir
- Diğer driver'lar (file, redis, memcached) için özel temizleme metodları kullanılmalıdır
- Wildcard
*karakteri kullanılabilir (SQL'de%olarak dönüştürülür) - Temizlenen cache sayısı response'da döner
Related Endpoints
- Para Birimi Cache Temizle - Para birimi cache'lerini temizle
- Çeviri Cache Temizle - Çeviri cache'lerini temizle