You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Ron West <we...@ohsu.edu> on 2011/09/30 02:41:54 UTC

API's available to clear cache

Hi,

New to the caching server and I apologize if this is not the place to post this, however I was hoping that someone could help me answer a few questions:

1.) Is there an API (REST, HTTP, or other) available to "invalidate" cache for a particular URL?
2.) In conjunction with that is there also an API (REST, HTTP, or other) available that can "build" cache for a particular URL?

Thanks for any help you can provide.

Re: API's available to clear cache

Posted by Leif Hedstrom <zw...@apache.org>.
Ron West wrote:
> Hi,
>
> New to the caching server and I apologize if this is not the place to post
> this, however I was hoping that someone could help me answer a few
> questions:
>
> 1.) Is there an API (REST, HTTP, or other) available to "invalidate" cache
> for a particular URL?

Well, that's what the PURGE method is for. E.g.

   PURGE /some/path/foo.png HTTP/1.1
   Host: www.example.com


Or some such. Or use the curl command line, with the -X PURGE argument.


> 2.) In conjunction with that is there also an API (REST, HTTP, or other)
> available that can "build" cache for a particular URL?

Yes, use the PUSH method. There are some threads on the mailing lists
explaining how to use it, and I think there's an example script too.

-- Leif