mlcache prefix purge
New purge task
Introduction
Asynchronously purge resources cached in the specified name
mlcache based on the prefix
.
asynchronous
means that the purge operation will be performed only when a mlcache get-like operation occurs for the old cache resources that meet the conditions (new cache resources that are created after the purge will not be purge repeatedly).
To avoid the accumulation of purge tasks, each purge task has a ttl
(time to live) in seconds, and the default time to live is one day (86400 seconds).
After the expiration date, the cleanup task will be invalidated, so it is recommended to set the ttl
to the maximum time to live of the cache resource itself.
URI
POST /admin-api/global/1/mlcache_purge
JSON body
{
"name":"my_cache",
"ttl": 3600,
"value":"foo"
}
Example request
Shell
curl \
-H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
https://{admin-site}/admin-api/global/1/mlcache_purge \
-d $'{"name":"my_cache", "ttl": 3600, "value":"foo"}'
Example response
Status: 200 OK
{"status":0,"data":{"id":1}}
Get the prefix purge task list
Introduction
Get mlcache prefix purge task
URI
GET /admin-api/global/1/mlcache_purge
URI parameters
page
type: integer
required: no
description: Results page (default 1)
page_size
type: integer
required: no
description: Results page size (default 20)
Request example
Shell
curl \
-H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
https://{admin-site}/admin-api/global/1/mlcache_purge
Example response
Status: 200 OK
{
"data":[
{
"id":1,
"name":"my_cache",
"ttl":3600,
"value":"foo"
}
],
"status":0
}