I'm submitting my react built to an s3 bucket, and have to invalidate the old build in cloudfront. I've tried a few invalidation patterns, but haven't dug into it too much. I find I have to invalidate the /static/js/main.xyz.js and then /*, to clear the cache. Why doesn't /* work alone? This is a small build, so I'm not too concerned about creating too many invalidations.
CodePudding user response:
Based on the official AWS documentation the /* invalidation seems to be a special case of invalidation that invalidates the entire distribution
Some more examples of invalidations are:
- /xyz/* invalidates the contents of xyz (but not subdirectories)
- /xyz* invalidates the contents of xyz and all subdirectories including their contents
etc