API Reference
PUTupdate_server_caching_config/{serverId}

Update Caching Config

Update Caching Config is a PUT request to https://api.sharkcluster.com/update_server_caching_config/{serverId} in the Server Management section of the SharkCluster API. Modifies the caching configuration for the entire server. This updates the database state; depending on the changes, a service restart may be required. It takes 2 parameters, 2 required (serverId and caching_config).

Request URL

PUThttps://api.sharkcluster.com/update_server_caching_config/{serverId}

How do you call Update Caching Config?

  1. 1Get a token from the login endpoint (POST /login) and send it as Authorization: Bearer <token>. See Login.
  2. 2Send a PUT request to https://api.sharkcluster.com/update_server_caching_config/{serverId}, replacing {serverId} in the path with your own value.
  3. 3Include the required parameter: caching_config.

Request parameters

ParameterTypeDescription
serverId
Required
stringThe Internal Server ID or Provider Instance ID.
caching_config
Required
objectThe new configuration object (e.g., {"driver": "redis", "enabled": true}).

What does Update Caching Config return?

A successful call returns a JSON object with the fields message and caching_config.

Request sample

const axios = require('axios');

const serverId = "0000-1111-2222";

const newConfig = {
  caching_config: {
    Manual: false,
    MemcachedToggle: false,
    Profiling: false,
    RedisToggle: false,
    Requrie1: true,
    VarnishToggle: false,
    eviction_policy_redis: "Allkeys-lru",
    max_clients_redis: "1000",
    max_connections_memcached: "1024",
    max_memory_usage_memcached: "512 MB",
    max_memory_usage_redis: "512 MB",
    object_size_limit_memcached: "1 MB",
    persistence_mode_redis: "AOF",
    profile_data_retention_varnish: "7 Days",
    profiling_frequency_varnish: "30 Sec",
    require2: false,
    slab_growth_factor_memcached: "1.25"
  }
};

axios.put(`https://api.sharkcluster.com/update_server_caching_config/${serverId}`, newConfig, {
  headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
})
.then(res => console.log(res.data.message))
.catch(err => console.error(err));

Response

{
    "message": "Caching config updated successfully",
    "caching_config": {
        "Manual": false,
        "Requrie1": true,
        "require2": false,
        "Profiling": false,
        "RedisToggle": false,
        "VarnishToggle": false,
        "MemcachedToggle": false,
        "max_clients_redis": "1000",
        "eviction_policy_redis": "Allkeys-lru",
        "max_memory_usage_redis": "512 MB",
        "persistence_mode_redis": "AOF",
        "max_connections_memcached": "1024",
        "max_memory_usage_memcached": "512 MB",
        "object_size_limit_memcached": "1 MB",
        "profiling_frequency_varnish": "30 Sec",
        "slab_growth_factor_memcached": "1.25",
        "profile_data_retention_varnish": "7 Days"
    }
}

Stuck on an integration?

Raise a ticket from the panel with the endpoint and the response you got back — it reaches an engineer with your server already attached.

Contact us