logo

Need Custom Apps?

Whether you need custom software development, Consulting or your project needs rescuing we are here to help. Get in touch
info@siege.ai
+27 11 794 3787

Amazon S3 and Cloudfront cache, how to clear cache

Amazon S3 and Cloudfront cache, how to clear cache

This is a quick guide to how you deploy a single page web application to S3 behind cloudfront

get your CloudFront distribution id

aws cloudfront list-distributions

Invalidate all files in the distribution, so CloudFront fetches fresh ones

aws cloudfront create-invalidation --distribution-id=S11A16G5KZMEQD --paths /

The actual full release script is

[[code]]czo3NTM6XCIjIS91c3IvYmluL2VudiBiYXNoDQoNCkJVQ0tFVD1teXNpdGUuY29tDQpTT1VSQ0VfRElSPWRpc3QvDQoNCmV4cG9ydCB7WyYqJl19QVdTX0FDQ0VTU19LRVlfSUQ9eHh4eHh4eHh4eHgNCmV4cG9ydCBBV1NfU0VDUkVUX0FDQ0VTU19LRVk9eHh4eHh4eHh4DQpleHBvcntbJiomXX10IEFXU19ERUZBVUxUX1JFR0lPTj1ldS13ZXN0LTENCg0KDQplY2hvIFwiQnVpbGRpbmcgcHJvZHVjdGlvblwiDQppZiBucG0gcnVuIGJ7WyYqJl19dWlsZDpwcm9kIDsgdGhlbg0KICAgZWNobyBcIkJ1aWxkIFN1Y2Nlc3NmdWxcIg0KZWxzZQ0KICBlY2hvIFwiZXhpdGluZy4uXCINCiAgZXh7WyYqJl19aXQgMQ0KZmkNCg0KDQplY2hvIFwiUmVtb3ZpbmcgYWxsIGZpbGVzIG9uIGJ1Y2tldFwiDQphd3MgczMgcm0gczM6Ly8ke0JVQ0tFVH0ge1smKiZdfS0tcmVjdXJzaXZlDQoNCg0KZWNobyBcIkF0dGVtcHRpbmcgdG8gdXBsb2FkIHNpdGUgLi5cIg0KZWNobyBcIkNvbW1hbmQ6ICBhd3MgczN7WyYqJl19ICBzeW5jICRTT1VSQ0VfRElSIHMzOi8vJEJVQ0tFVC9cIg0KYXdzIHMzICBzeW5jICR7U09VUkNFX0RJUn0gczM6Ly8ke0JVQ0tFVH17WyYqJl19Lw0KZWNob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