s3cmd
s3cmd copied to clipboard
How to purge cache directly from s3cmd
Hello.
Is there a s3cmd command to purge the cache? It's so annoying to always purge the cache from the dashboard.
Thanks in advance!
That's a really good idea!
Do you normally invalidate the whole site ( /* ) or just a few files?
Normally the whole site. But both is good options to have..
I'm right that your are speaking about the "cloudfront" invalidation? if yes, there is a pending work to allow it.
The cfinval command was just added in MASTER to manually request invalidation for paths.
Examples of usage:
- Invalidate 2 files:
s3cmd cfinval "s3://mybucket/file1" "s3://mybucket/other/file.txt" - Invalidate the whole bucket:
s3cmd cfinval "s3://mybucket" - Invalidate all the content of a folder:
s3cmd cfinval "s3://mybucket/folder1/" - Invalidate files using a wildcard:
s3cmd cfinval "s3://mybucket/folder1/images-2022*"