[
https://issues.apache.org/jira/browse/TS-4395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15265478#comment-15265478
]
Leif Hedstrom edited comment on TS-4395 at 4/30/16 8:42 PM:
------------------------------------------------------------
How about:
{code}
map http://example.com/p1 http://p1.example.com \
@plugin=remap_purge.so @pparam=--secret=PURGEE @pparam=--header=ATS-Purgee
@pparam=--state_file=example_p1
{code}
and
{code}
fedora (14:36) 471/0 $ curl -H "ATS-Purgee: PURGEE" -D - -s
http://example.com/p1/
HTTP/1.1 200 OK
Date: Sat, 30 Apr 2016 20:37:09 GMT
Connection: close
Server: ATS/7.0.0
Content-Length: 39
Content-Type: text/html
PURGED http://example.com/p1
{code}
>From ATS trace:
{code}
[Apr 30 14:39:48.539] Server {0x7f00715e3840} DIAG: (remap_purge) initialized
[Apr 30 14:39:48.539] Server {0x7f00715e3840} DIAG: (remap_purge) Read genID
from /opt/ats/var/trafficserver/remap_purge/example_p1.genid for (null)
[Apr 30 14:39:50.237] Server {0x7f006b33d700} DIAG: (remap_purge) Checking for
PURGEE == PURGEE
[Apr 30 14:39:50.238] Server {0x7f006b33d700} DIAG: (remap_purge) Bumping the
Generation ID to 4 for http://example.com/p1
[Apr 30 14:39:50.238] Server {0x7f006b33d700} DIAG: (remap_purge) saving
state to /opt/ats/var/trafficserver/remap_purge/example_p1.genid
[Apr 30 14:39:50.238] Server {0x7f006b33d700} DIAG: (remap_purge) Fixing up the
response on the succseful PURGE
{code}
I retained both variants though, but modified the config options slightly (the
secret is now shared with both paths, but if you use the --header option, it's
checking that header instead of the path).
was (Author: zwoop):
How about:
{code}
map http://example.com/p1 http://p1.example.com \
@plugin=remap_purge.so @pparam=--secret=PURGEE @pparam=--header=ATS-Purgee
@pparam=--state_file=example_p1
{code}
and
{code}
fedora (14:36) 471/0 $ curl -H "ATS-Purgee: PURGEE" -D - -s
http://fedora.ogre.com/bench/
HTTP/1.1 200 OK
Date: Sat, 30 Apr 2016 20:37:09 GMT
Connection: close
Server: ATS/7.0.0
Content-Length: 39
Content-Type: text/html
PURGED http://example.com/p1
{code}
>From ATS trace:
{code}
[Apr 30 14:39:48.539] Server {0x7f00715e3840} DIAG: (remap_purge) initialized
[Apr 30 14:39:48.539] Server {0x7f00715e3840} DIAG: (remap_purge) Read genID
from /opt/ats/var/trafficserver/remap_purge/example_p1.genid for (null)
[Apr 30 14:39:50.237] Server {0x7f006b33d700} DIAG: (remap_purge) Checking for
PURGEE == PURGEE
[Apr 30 14:39:50.238] Server {0x7f006b33d700} DIAG: (remap_purge) Bumping the
Generation ID to 4 for http://example.com/p1
[Apr 30 14:39:50.238] Server {0x7f006b33d700} DIAG: (remap_purge) saving
state to /opt/ats/var/trafficserver/remap_purge/example_p1.genid
[Apr 30 14:39:50.238] Server {0x7f006b33d700} DIAG: (remap_purge) Fixing up the
response on the succseful PURGE
{code}
I retained both variants though, but modified the config options slightly (the
secret is now shared with both paths, but if you use the --header option, it's
checking that header instead of the path).
> conf_purge: Simple plugin to purge an entire remap rule
> -------------------------------------------------------
>
> Key: TS-4395
> URL: https://issues.apache.org/jira/browse/TS-4395
> Project: Traffic Server
> Issue Type: New Feature
> Components: Plugins
> Reporter: Leif Hedstrom
> Assignee: Leif Hedstrom
> Fix For: 7.0.0
>
>
> This is similar to the existing plugin to purge based on a genID stored in a
> persistent storage. The difference is that the purging is done exclusively
> via a restful API, and has little (no) overhead on performance (since the
> generation ID is always in memory).
> Example:
> {code}
> map http://example.com/p1 http://p1.example.com
> @plugin=remap_purge.so @pparam=--path=__secret_purge__
> @pparam=--state=example_p1
> {code}
> And to purge:
> {code}
> $ curl -s -D - -X PURGE http://example.com/p1/__secret_purge__
> HTTP/1.1 200 OK
> Date: Sat, 30 Apr 2016 00:09:34 GMT
> Connection: close
> Server: ATS/7.0.0
> Content-Length: 39
> Content-Type: text/html
> PURGED http://example.com/p1
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)