Update Cache Settings
Updates the cache settings of the platform.
HTTP Request
PATCH/api/settings/cache
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token authentication
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| cache_products_cache | Boolean | No | Enable products list caching (default: false) |
| cache_products_cache_timeout | Integer | No | Products cache timeout in seconds (default: 60) |
| cache_products_cache_prefix | String | No | Products cache key prefix (default: "products", max 128 chars) |
| cache_product_cache | Boolean | No | Enable individual product caching (default: false) |
| cache_product_cache_timeout | Integer | No | Product cache timeout in seconds (default: 60) |
| cache_product_cache_prefix | String | No | Product cache key prefix (default: "product", max 128 chars) |
| cache_products_metadata_cache | Boolean | No | Enable products metadata caching (default: false) |
| cache_products_metadata_cache_timeout | Integer | No | Products metadata cache timeout (default: 60) |
| cache_products_metadata_cache_prefix | String | No | Products metadata cache prefix (default: "products_metadata", max 128 chars) |
| cache_categories_cache | Boolean | No | Enable categories list caching (default: false) |
| cache_categories_cache_timeout | Integer | No | Categories cache timeout in seconds (default: 60) |
| cache_categories_cache_prefix | String | No | Categories cache key prefix (default: "categories", max 128 chars) |
| cache_category_cache | Boolean | No | Enable individual category caching (default: false) |
| cache_category_cache_timeout | Integer | No | Category cache timeout in seconds (default: 60) |
| cache_category_cache_prefix | String | No | Category cache key prefix (default: "category", max 128 chars) |
| cache_brands_cache | Boolean | No | Enable brands list caching (default: false) |
| cache_brands_cache_timeout | Integer | No | Brands cache timeout in seconds (default: 60) |
| cache_brands_cache_prefix | String | No | Brands cache key prefix (default: "brands", max 128 chars) |
| cache_brand_cache | Boolean | No | Enable individual brand caching (default: false) |
| cache_brand_cache_timeout | Integer | No | Brand cache timeout in seconds (default: 60) |
| cache_brand_cache_prefix | String | No | Brand cache key prefix (default: "brand", max 128 chars) |
| cache_posts_cache | Boolean | No | Enable posts list caching (default: false) |
| cache_posts_cache_timeout | Integer | No | Posts cache timeout in seconds (default: 60) |
| cache_posts_cache_prefix | String | No | Posts cache key prefix (default: "posts", max 128 chars) |
| cache_post_cache | Boolean | No | Enable individual post caching (default: false) |
| cache_post_cache_timeout | Integer | No | Post cache timeout in seconds (default: 60) |
| cache_post_cache_prefix | String | No | Post cache key prefix (default: "post", max 128 chars) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Update cache settings
4response = requests.patch('http://www.example.com/api/settings/cache',
5 headers={'Authorization': 'Token <your_api_key>'},
6 json={
7 "cache_products_cache": true,
8 "cache_products_cache_timeout": 120
9 }
10)
11print(response.json())1# Update cache settings
2curl -X PATCH "http://www.example.com/api/settings/cache" -H "Authorization: Token <your_api_key>" -d '{
3 "cache_products_cache": true,
4 "cache_products_cache_timeout": 120
5}'Status Codes
| Code | Description |
|---|---|
| 200 | Request logs retrieved successfully |
| 400 | Bad request — invalid query parameters |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| cache_products_cache | Boolean | Enable products list caching (default: false) |
| cache_products_cache_timeout | Integer | Products cache timeout in seconds (default: 60) |
| cache_products_cache_prefix | String | Products cache key prefix (default: "products", max 128 chars) |
| cache_product_cache | Boolean | Enable individual product caching (default: false) |
| cache_product_cache_timeout | Integer | Product cache timeout in seconds (default: 60) |
| cache_product_cache_prefix | String | Product cache key prefix (default: "product", max 128 chars) |
| cache_products_metadata_cache | Boolean | Enable products metadata caching (default: false) |
| cache_products_metadata_cache_timeout | Integer | Products metadata cache timeout (default: 60) |
| cache_products_metadata_cache_prefix | String | Products metadata cache prefix (default: "products_metadata", max 128 chars) |
| cache_categories_cache | Boolean | Enable categories list caching (default: false) |
| cache_categories_cache_timeout | Integer | Categories cache timeout in seconds (default: 60) |
| cache_categories_cache_prefix | String | Categories cache key prefix (default: "categories", max 128 chars) |
| cache_category_cache | Boolean | Enable individual category caching (default: false) |
| cache_category_cache_timeout | Integer | Category cache timeout in seconds (default: 60) |
| cache_category_cache_prefix | String | Category cache key prefix (default: "category", max 128 chars) |
| cache_brands_cache | Boolean | Enable brands list caching (default: false) |
| cache_brands_cache_timeout | Integer | Brands cache timeout in seconds (default: 60) |
| cache_brands_cache_prefix | String | Brands cache key prefix (default: "brands", max 128 chars) |
| cache_brand_cache | Boolean | Enable individual brand caching (default: false) |
| cache_brand_cache_timeout | Integer | Brand cache timeout in seconds (default: 60) |
| cache_brand_cache_prefix | String | Brand cache key prefix (default: "brand", max 128 chars) |
| cache_posts_cache | Boolean | Enable posts list caching (default: false) |
| cache_posts_cache_timeout | Integer | Posts cache timeout in seconds (default: 60) |
| cache_posts_cache_prefix | String | Posts cache key prefix (default: "posts", max 128 chars) |
| cache_post_cache | Boolean | Enable individual post caching (default: false) |
| cache_post_cache_timeout | Integer | Post cache timeout in seconds (default: 60) |
| cache_post_cache_prefix | String | Post cache key prefix (default: "post", max 128 chars) |