service.expireCacheObject

Description

Expires a specific object from the content cache for a given service and cache key passed.

Parameters

spkey

A string representing the unique id of the service that the cache object is cached within.  You may find this in the API Settings area of the Mashery Portal Dashboard.

URL

A string representing the full URL of the cached object.  Parameter order is not important as the API will reorder the params to match the content cache store order.  In addition, if the service definition cache algorithm strips api keys from the cache key, this method will also do so if any api key is passed in the method.

HTTP Methods (optional)

An array of HTTP methods for the URL. If omitted then only URLs called via GET will be removed from cache.

Response

Boolean indicating if item was removed or not in cache otherwise an error if there was a problem with the request.

Notes

The latency between eviction command issuance and cache eviction is approximately 5-8 minutes.

Examples

A Sample JSON-RPC Expire Cache Object Request using default HTTP method

{
    "method": "service.expireCacheObject",
    "params": ["your_service_key_here", "http:\/\/www.example.org\/myresource?version=v1&count=10&offset=0"],
    "id": 1
}

A Sample JSON-RPC Expire Cache Object Request specifying HTTP methods

{
    "method": "service.expireCacheObject",
    "params": ["your_service_key_here", "http:\/\/www.example.org\/myresource?version=v1&count=10&offset=0", ["GET", "POST"]],
    "id": 1
}

The JSON-RPC Response

{
    "result": true,
    "error": null,
    "id": 1
}

Permissions Required

The user who owns the key used to authenticate the service.expireCacheObject call must be a member of one of the following roles

  • Administrator
  • Api Manager

See authentication.

Errors

In addition to the standard json-rpc errors and authentication errors, service.expireCacheObject may also return these errors:

HTTP Status Code JSON-RPC Code Error Message Description
400 1002 Field "id" is required You've passed an object to trigger the alternative object identifier syntax, but that object does not contain an id field.
400 5000 Object "type" with "key" of "value" could not be found The object could not be updated because it could not be found.

Docs Navigation