Skip to main content

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

FieldTypeRequiredDescription
cache_products_cacheBooleanNoEnable products list caching (default: false)
cache_products_cache_timeoutIntegerNoProducts cache timeout in seconds (default: 60)
cache_products_cache_prefixStringNoProducts cache key prefix (default: "products", max 128 chars)
cache_product_cacheBooleanNoEnable individual product caching (default: false)
cache_product_cache_timeoutIntegerNoProduct cache timeout in seconds (default: 60)
cache_product_cache_prefixStringNoProduct cache key prefix (default: "product", max 128 chars)
cache_products_metadata_cacheBooleanNoEnable products metadata caching (default: false)
cache_products_metadata_cache_timeoutIntegerNoProducts metadata cache timeout (default: 60)
cache_products_metadata_cache_prefixStringNoProducts metadata cache prefix (default: "products_metadata", max 128 chars)
cache_categories_cacheBooleanNoEnable categories list caching (default: false)
cache_categories_cache_timeoutIntegerNoCategories cache timeout in seconds (default: 60)
cache_categories_cache_prefixStringNoCategories cache key prefix (default: "categories", max 128 chars)
cache_category_cacheBooleanNoEnable individual category caching (default: false)
cache_category_cache_timeoutIntegerNoCategory cache timeout in seconds (default: 60)
cache_category_cache_prefixStringNoCategory cache key prefix (default: "category", max 128 chars)
cache_brands_cacheBooleanNoEnable brands list caching (default: false)
cache_brands_cache_timeoutIntegerNoBrands cache timeout in seconds (default: 60)
cache_brands_cache_prefixStringNoBrands cache key prefix (default: "brands", max 128 chars)
cache_brand_cacheBooleanNoEnable individual brand caching (default: false)
cache_brand_cache_timeoutIntegerNoBrand cache timeout in seconds (default: 60)
cache_brand_cache_prefixStringNoBrand cache key prefix (default: "brand", max 128 chars)
cache_posts_cacheBooleanNoEnable posts list caching (default: false)
cache_posts_cache_timeoutIntegerNoPosts cache timeout in seconds (default: 60)
cache_posts_cache_prefixStringNoPosts cache key prefix (default: "posts", max 128 chars)
cache_post_cacheBooleanNoEnable individual post caching (default: false)
cache_post_cache_timeoutIntegerNoPost cache timeout in seconds (default: 60)
cache_post_cache_prefixStringNoPost cache key prefix (default: "post", max 128 chars)

Example Requests

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())

Status Codes

CodeDescription
200Request logs retrieved successfully
400Bad request — invalid query parameters
401Unauthorized — authentication required
403Forbidden — insufficient permissions
500Internal server error

Response Fields

FieldTypeDescription
cache_products_cacheBooleanEnable products list caching (default: false)
cache_products_cache_timeoutIntegerProducts cache timeout in seconds (default: 60)
cache_products_cache_prefixStringProducts cache key prefix (default: "products", max 128 chars)
cache_product_cacheBooleanEnable individual product caching (default: false)
cache_product_cache_timeoutIntegerProduct cache timeout in seconds (default: 60)
cache_product_cache_prefixStringProduct cache key prefix (default: "product", max 128 chars)
cache_products_metadata_cacheBooleanEnable products metadata caching (default: false)
cache_products_metadata_cache_timeoutIntegerProducts metadata cache timeout (default: 60)
cache_products_metadata_cache_prefixStringProducts metadata cache prefix (default: "products_metadata", max 128 chars)
cache_categories_cacheBooleanEnable categories list caching (default: false)
cache_categories_cache_timeoutIntegerCategories cache timeout in seconds (default: 60)
cache_categories_cache_prefixStringCategories cache key prefix (default: "categories", max 128 chars)
cache_category_cacheBooleanEnable individual category caching (default: false)
cache_category_cache_timeoutIntegerCategory cache timeout in seconds (default: 60)
cache_category_cache_prefixStringCategory cache key prefix (default: "category", max 128 chars)
cache_brands_cacheBooleanEnable brands list caching (default: false)
cache_brands_cache_timeoutIntegerBrands cache timeout in seconds (default: 60)
cache_brands_cache_prefixStringBrands cache key prefix (default: "brands", max 128 chars)
cache_brand_cacheBooleanEnable individual brand caching (default: false)
cache_brand_cache_timeoutIntegerBrand cache timeout in seconds (default: 60)
cache_brand_cache_prefixStringBrand cache key prefix (default: "brand", max 128 chars)
cache_posts_cacheBooleanEnable posts list caching (default: false)
cache_posts_cache_timeoutIntegerPosts cache timeout in seconds (default: 60)
cache_posts_cache_prefixStringPosts cache key prefix (default: "posts", max 128 chars)
cache_post_cacheBooleanEnable individual post caching (default: false)
cache_post_cache_timeoutIntegerPost cache timeout in seconds (default: 60)
cache_post_cache_prefixStringPost cache key prefix (default: "post", max 128 chars)