• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

cloudfront

Use Object Versioning With CloudFront

January 11, 2020

If you are using AWS CloudFront, you can avoid costly invalidations by using object versioning. Due to the nature of CloudFront, overwriting to the same file will not have any effect until caching is invalidated. The default timeout for CloudFront is 24 hours. If you have a website and you’ve overwritten your logo image, the updated image file will not be reflected on your site due to the caching timeout is 24 hours. To avoid invalidation, enable object versioning by adding a policy when overwriting files.

# Logo Image
<a href="logo.png">Website Logo</a>
#
# Implement object versioning. 
# Increase the filename after each logo change.
#
<a href="logo-001.png">Website Logo</a>
<a href="logo-002.png">Website Logo</a>
<a href="logo-003.png">Website Logo</a>
<a href="logo-004.png">Website Logo</a>

# Logo Image <a href="logo.png">Website Logo</a> # # Implement object versioning. # Increase the filename after each logo change. # <a href="logo-001.png">Website Logo</a> <a href="logo-002.png">Website Logo</a> <a href="logo-003.png">Website Logo</a> <a href="logo-004.png">Website Logo</a>

Each time the logo is updated, change the filename to avoid CloudFront invalidation.

Filed Under: Cloud Tagged With: aws, caching, cloudfront, invalidation

CloudFront XML Error

June 30, 2019

If you’re seeing an XML error, check the default root object in your CloudFront distribution.

CloudFront distribution setting

It should be set to your index page.

Filed Under: Cloud Tagged With: aws, cloudfront, default root object, error, index.html, xml

CloudFront SSL Certificates

January 4, 2019

If you have SSL on your website, you can import your own SSL certificates into CloudFront, which is a content delivery network service by AWS. You will need to work a few AWS services to get it working.

  • CloudFront – create a distribution
  • Route 53 – create a hosted zone and add a CNAME
  • Certificate Manager – import your SSL certificate

Finally, on the WordPress side, enable the use CloudFront in your SuperCache plugin.

Seems simple, but you’ll need some patience to get it working.

Look at your HTML source to see if your CDN is really working.

Filed Under: Cloud, WP Tagged With: certificate, cloudfront, cname, route 53, ssl

Serverless Jekyll on AWS

July 21, 2017

I recently started playing around with Jekyll.

Jekyll is a flat-file CMS that doesn’t need a database. You don’t even need to know HTML to work with it. You just write your content using the Markdown language on any text editor. Once you’re done editing, you run “jekyll build” and Jekyll takes care of the rest. Since Jekyll files are stored on flat-files, you have quite a few choices where to host your website. You can host it on just about any hosting provider. You can have it hosted on Github for free, or better yet can run it as a serverless website on Amazon S3. Serverless meaning, it’s not running on a web server since S3 can host static files. In addition, you can take advantage of Cloudfront for its content distribution to speed up your website, and give it high availability.

So, here’s a demo of Jekyll running on AWS S3 and Cloudfront.

You can learn more about Jekyll by visiting their website.

Filed Under: Cloud Tagged With: aws s3, cloudfront, jekyll

  • Home
  • About
  • Archives

Copyright © 2023