Estimated Reading Time: 2 minutes|Last Updated: 11/19/2021, 7:57:43 AM

# Purge Cache

# usage

Usage: oredge cache purge [http] [OPTIONS]

OPTIONS:
    --condition json                   condition, can add multiple times.
        variable object
            name string                variable name, uri,uri-arg,uri-seg,query-string,sorted-query-string,host,req-method,req-cookie,req-header,scheme,server-port,server-addr,first-x-forwarded-addr,last-x-forwarded-addr.
            args string|integer        args.
        operator object
            name string                operator name, eq,ne,lt,le,gt,ge,contains,contains-word,prefix,suffix,!contains,!contains-word,!prefix,!suffix.
        values array
            type string                str or rx or wc. 
            value string               value. 
        caseless bool                  is caseless, true or false.
    --url string                       url, can add multiple times.
    --http integer                     http application id.
    --type string                      urls(default) or conditional or prefix.
    --note string                      note.

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

--http "http id"

Specify to which http application the cache is purged.

You can specify it in two method

    oredge cache purge 1

or

    oredge cache purge --http 1

--note "description string"

You can add a description to this cache purge

--type "type of cache purge"

It can be urls, conditional, prefix

--url "url string"

If the type is urls or prefix, this argument is required, for example: --url "http://test.com/a/b"

--condition "json string"

If the type is conditional, this argument is required.

# example

we can use --http to specify http or specify http id directly.

  1. purge cache.
# oredge cache purge 887 --url "http://test.label.com/a/b"
ID: 887-84
  1. purge cache with conditional type
# oredge cache purge 887 --type conditional --condition '{"variable":{"name":"uri"},"operator":{"name":"prefix"},"values":[{"type":"str","val":"/a/b"}],"caseless":false}'
ID: 887-85
  1. purge cache with prefix type
# bin/oredge cache purge 887 --type prefix --url "http://test.com/a/" --url "http://test.com/b/"
ID: 887-86