AWS CloudFront Invalidation for Specific Routes with S3 Origin


Hello Team,

I am extremely interested in learning how AWS CloudFront manages invalidations for the S3 origin with multiple routes. I have a website called "" that is served by CloudFront and contains a large number of CSS and JS files only in the folder called "myproject." Numerous paths are available, including "," "," and ""

If I modify the login or user-related files, I typically use "/" to invalidate the cache for the entire website whenever I make changes to any file. I am unsure of the invalidation strategy, though, for changes that are more targeted, such as those in "/" or "/myproject/order/." Can I individually invalidate these routes using "/" and "/*," or does AWS CloudFront only invalidate the S3 objects without taking the specific URLs into account?

Thanks Rishabh

1 Answer
Accepted Answer

Hi, yes you can provide different invalidation rules, check this out: and it’s examples as you can combine them in multiple lines in the text area of the invalidation rules section.

profile picture
answered a year ago
profile picture
reviewed a year ago
  • Thanks, Antonio for your comment. So that means, Instead of invalidating my entire project every time, I can simply invalidate the path that needs to be invalidated.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions