diff --git a/reset-cf-cache/Dockerfile b/cf-reset-cache/Dockerfile similarity index 100% rename from reset-cf-cache/Dockerfile rename to cf-reset-cache/Dockerfile diff --git a/reset-cf-cache/reset-cache.py b/cf-reset-cache/reset-cache.py similarity index 77% rename from reset-cf-cache/reset-cache.py rename to cf-reset-cache/reset-cache.py index 4a50f88..2698000 100644 --- a/reset-cf-cache/reset-cache.py +++ b/cf-reset-cache/reset-cache.py @@ -29,10 +29,18 @@ docs = s3_conn.get_bucket(bucket) items = [] for key in docs.list(): + index_file = "/index.html" + if key.name.endswith((index_file)): + # append the file without the postfix as well + items.append(key.name.replace(index_file, "")) + items.append(key.name.replace(index_file, "/")) items.append(key.name) cf_conn = boto.connect_cloudfront(access_key, access_secret) inval_req = cf_conn.create_invalidation_request(cloudfront_dist, items) +print "Invalidating these files: " +print items + print inval_req -sys.exit(0) \ No newline at end of file +sys.exit(0)