AWS CloudFront Invalidation for Specific Routes with S3 Origin

0

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 "myproject.com" 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 "myproject.com/order/payment/," "myproject.com/users/login/," and "myproject.com/documentation/contact/."

If I modify the login or user-related files, I typically use "/myproject.com/" 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 "/myproject.com/order/payment" or "/myproject/order/." Can I individually invalidate these routes using "/myproject.com/order/payment/" and "/myproject.com/order/*," or does AWS CloudFront only invalidate the S3 objects without taking the specific URLs into account?

Thanks Rishabh

1 Answer
0
Accepted Answer

Hi, yes you can provide different invalidation rules, check this out: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html and it’s examples as you can combine them in multiple lines in the text area of the invalidation rules section.

profile picture
EXPERT
answered a year ago
profile picture
EXPERT
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