Today when using Postman I noticed the method option of PURGE
. I have never encountered it in practice and cannot find the explanation of it's purpose.
What is this method used for, where did it come from, and is there a spec for it somewhere?
Today when using Postman I noticed the method option of PURGE
. I have never encountered it in practice and cannot find the explanation of it's purpose.
What is this method used for, where did it come from, and is there a spec for it somewhere?
There is an HTTP PURGE
method, though it is not defined in the HTTP RFCs (which do allow for custom methods beyond the standard defined methods). Some HTTP servers and caching systems actually do implement PURGE
, for instance Squid and Varnish:
Squid: How can I purge an object from my cache?
Varnish: Purging and banning
And it is possible to send PURGE
requests with curl, for example:
Method = "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT" | extension-method
. Custom methods are supposed to be registered with IANA, but PURGE
is not registered. –
Scherer I use the PURGE method if I need to clear the cach in varnish (at the apache level, before php)
wget --method=PURGE --header "x-purge-token: xxx" -H -S www.excepted.com/a/b/c.html
If you look head response this info is cache
age: 656
x-cache: HIT|MISS
x-cv: ftp.server.com
© 2022 - 2024 — McMap. All rights reserved.
PURGE
verb, it is just not defined in the HTTP RFCs. Some HTTP servers and caching systems, such as Squid and Varnish, actually do implementPURGE
(see this), and even curl supports sendingPURGE
requests (see this). – Scherer