Purge Server

GET POST

Purges the Edgemesh® Server cache. Edgemesh® Server implements a stale while revalidate strategy and cached objects are revalidated on request every 15 minutes. Purging caches have negative impacts on performance while caches are rebuilt and should be avoided if possible. Instead, let Edgemesh® automatically update the caches for the best-sustained performance. Edgemesh® Server provides more fine-grained control over cache purges so you can purge specific resources.

This route is exposed as both a GET and a POST. This provides flexibility when used as a webhook endpoint. When requesting with the GET method, all request parameters are provided via search parameters. When requesting with the POST method, the request parameters are sent in the request body.

Request Parameters


REQUIRED
The hostname of the domain whose cache will be purged.

type
string
REQUIRED
The type of purge to perform.
  • all: Purge all resources. No additional parameters are required with this purge type.
  • pathname: Purge by specific pathname. The pathname excludes all search parameters and must start with /. When this type is selected, the pathname parameter is also required.
  • mime: Purge by a specific content type. When this type is selected, the mime parameter is also required.

pathname
string
OPTIONAL
If the purging type is pathname, this is the pathname to purge. It must start with / and exclude all search parameters.

mime
string
OPTIONAL
If the purging type is mime, this is the content type to purge.
  • html: Purge all hypertext markup language (HTML) documents.
  • css: Purge all cascading style sheets (CSS).
  • json: Purge all javascript object notation (JSON) responses.
  • xml: Purge all extensible markup language (XML) documents.
  • text: Purge all plain text responses.
  • javascript: Purge all javascript responses.
  • image: Purge all image responses.
  • media: Purge all audio and video responses.

Response Properties


ok
boolean
Whether or not the request succeeded.

URL
https://api.edgemesh.com/2022-08/cache/purge/server
GETPurge Server All
1curl https://api.edgemesh.com/2022-08/cache/purge/server?hostname=example.com&type=all /
2 -H 'Accept: application/json' /
3 -H 'X-API-Key: EM-0000000-0000000-0000000-0000000'
POSTPurge Server All
1curl https://api.edgemesh.com/2022-08/cache/purge/server /
2 -X POST /
3 -H 'Accept: application/json' /
4 -H 'X-API-Key: EM-0000000-0000000-0000000-0000000' /
5 -d '{ "hostname": "example.com", "type": "all" }'
Example Response
1{
2 "ok": true
3}

Made withby Edgemesh Corporation