How can I delete all files in a folder from GAE?

6 views
Skip to first unread message

Kane

unread,
Jan 21, 2011, 2:26:56 AM1/21/11
to CirruxCache
Thank you,Samuel, for your great work.
I wonder if there's a way to flush all files in a specific folder?
I tried to use
$ curl -X DELETE http://xxx.xxx.com/aaa/__ALL__
but it didn't work.
We need to override many files in a folder and want it to be seen by
the visitor ASAP.

Any idea? Thanks.

Samuel Alba

unread,
Jan 21, 2011, 2:43:11 AM1/21/11
to cirru...@googlegroups.com
Hi,

It's not possible to delete file in a specific folder, just because
it's not possible to SELECT from a pattern on the Datastore.

The pattern __ALL__ is used to delete all the files in a Service.

You have some possible ways:
- $ curl -X DELETE http://xxxx/file.ext (on each file you want to purge)
- Find a way to set a version on your file, for example if you call
your script.js from your html page, update the html to match
script.0.1.js or whatever version, each time you need to update it. So
you will only need to flush the html then.
- Wait for the TTL to expire if it's not to long.

For a purge request, keep in mind that is mandatory to authorize your
IP address to flush (cf. cirruxcache documentation). And a DELETE on
__ALL__ needs to be called several time - depending on your datastore
size. Because this request times out several times until all objects
are flushed.

Best,

- Sam

> --
> Project page: http://code.google.com/p/cirruxcache/
> News: http://www.shad.cc/tag/cirruxcache
> Groups: http://groups.google.com/group/cirruxcache
>

--
Samuel Alba

Kane

unread,
Jan 21, 2011, 3:21:13 AM1/21/11
to CirruxCache
Thank you for your fast reply.
Is it possible to purge all files in a pop or the whole CirruxCache
service?
We're fine if the CirruxCache need to pull all the files from the
original server again.

On 1月20日, 下午11时43分, Samuel Alba <sam.a...@gmail.com> wrote:
> Hi,
>
> It's not possible to delete file in a specific folder, just because
> it's not possible to SELECT from a pattern on the Datastore.
>
> The pattern __ALL__ is used to delete all the files in a Service.
>
> You have some possible ways:
> - $ curl -X DELETEhttp://xxxx/file.ext(on each file you want to purge)
Reply all
Reply to author
Forward
0 new messages