Page tree
Skip to end of metadata
Go to start of metadata

This page is in progress. We will not publish it together with the 5.6 release. It is visible for Magnolians only for the time being.

This page describes the cache endpoint, which can be used to access and manipulate the cache. 

GET

Ping

Checks if the service is alive.

Request URL

/.rest/cache/v1/ping

Example

curl -X GET http://localhost:8080/magnoliaPublic/.rest/cache/v1/ping \
 -u superuser:superuser

Get all

Returns all cache keys from the specified cache.

Request URL

/.rest/cache/v1/{cacheName}/getAll

Parameters

Parameter

Description

Parameter type

Data type

cacheName

required

Specify the cache by name.

path

String

Example

curl -X GET http://localhost:7070/magnoliaPublic/.rest/cache/v1/defaultPageCache/getAll \
-u superuser:superuser

 Click to see the response
{  
   "@type":"java.util.ArrayList",
   "@items":[  
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/.resources/defaultMagnoliaLoginForm/css/fonts/DINWebPro.woff",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      },
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/.resources/defaultMagnoliaLoginForm/img/logo-magnolia.svg",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      },
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/.resources/defaultMagnoliaLoginForm/img/favicon.ico",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      },
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/.resources/defaultMagnoliaLoginForm/css/login.css",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      },
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/.resources/defaultMagnoliaLoginForm/css/reset.css",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      },
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/.resources/defaultMagnoliaLoginForm/css/fonts.css",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      },
      {  
         "@type":"info.magnolia.module.cache.cachekey.DefaultCacheKey",
         "isSecured":false,
         "uri":"/",
         "serverName":"localhost",
         "channel":"all",
         "locale":"en",
         "method":"get",
         "params":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         },
         "additionalAttributes":{  
            "@type":"java.util.Collections$UnmodifiableMap"
         }
      }
   ]
}

Get

Get cache keys based on an offset and page length.

Request URL

/.rest/cache/v1/{cacheName}/get

Parameters

Parameter

Description

Parameter type

Data type

cacheName

required

Specify the cache by name.

path

String

offset

optional, default is 0

Reduce the number of results with an offset.

query

int

pageLength

required

Page length must be greater 0.

query

int

sortOrder

optional, must also supply a sortProperty

The direction of the sort in respect to the sortProperty.

query

String

sortProperty

optional, must also supply a sortOrder

Property to sort on (i.e. uri, channel, locale, method, ...).

URI "extension" is also possible.

query

String

Size

Returns cache size for a specified cache.

Request URL

/.rest/cache/v1/{cacheName}/size

Parameters

Parameter

Description

Parameter type

Data type

cacheName

required

Specify the cache by name.

path

String

Download

Return cache content for the specified cache key.

Request URL

/.rest/cache/v1/{cacheName}/download

Parameters

Parameter

Description

Parameter type

Data type

cacheName

required

Specify the cache by name.

path

String

cacheKey

required

The entire cache key provided in JSON.

query

String


DELETE

Deletes an item from the cache based on the passed cache key.

Request URL

/.rest/cache/v1/{cacheName}/delete

Parameters

Parameter

Description

Parameter type

Data type

cacheName

required

Specify the cache by name.

path

String

cacheKey

required

The entire cache key provided in JSON.

query

String