laurilehmijoki / configure-s3-website

Ruby gem for configuring an AWS S3 bucket to function as a website
MIT License
40 stars 20 forks source link

Invalidating items on CloudFront #14

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi there,

I have Jekyll with incremental build enabled but every time I run 's3_wesbite push' from the terminal, it is invalidating the entire site. It's costing me a small fortune in AWS fees. I thought incremental only touched the files that had changed.

What am I doing wrong?

Regards

laurilehmijoki commented 8 years ago

Can you share the source code of your site? Without confidential credentials of course. It's difficult to debug otherwise.

ghost commented 8 years ago

Sure. Thank you for helping me.

s3_website.txt

laurilehmijoki commented 8 years ago

Jason your config seems fine to me. Anyway there should be no optiob that causes the behaviour you are experiencing. I'm out of guesses. As a workaround, why not remove the CloudFront distribution id from the config and set the cache max age to something sensible? You can also generate cache-busted URLs (maybe https://github.com/tkareine/jekyll-minibundle will help you). That way you can benefit from CloudFront even without explicit invalidations.