A Swiss Geek previously in Singapore, now in Portugal

CloudFront

Diving into Cloudfront

Cloudfront can be simply defined as a CDN (Content Delivery Network), caching your static assets in a datacenter nearer to your viewers. But Cloudfront is a lot more complex and versatile than this simple definition. Cloudfront is a “pull” CDN, which means that you don’t push your content to the CDN. The content is pulled into the CDN Edge from the origin at the first request of any piece of content.

Read More…

Use IAM Identity Center (AWS SSO) to protect your Cloudfront served application

You built a new web application, you are serving it using Cloudfront, but you want that only members from your organization can view the pre-release version. You want to add a password protection using the already existing IAM Identity Center (Successor to AWS Single Sign-On) to grant access to your organization.

Resize Images on the Fly

Clients know the best what sizes an image should be (screen size, dpr, …). Don’t pre-generate useless sizes and let them ask for the dimensions that suits them best.

Cors at the Edge

With the raise of API driven apps, CORS is becoming an unavoidable subject. By adding a CDN, your CORS rules become a burden on caching.

From Wordpress to Hugo

As mentioned in Going Static, I migrated my Wordpress blogs to a static site build with Hugo. Most articles on the subject convinced me that it would be easy. The truth is, it isn’t that straight forward. Content With help of a Wordpress plugin, exporting your posts and content is easy. The plugin adds the necessary front matter in Yaml format. But you still need to go through all your posts to update manually all image references.

Read More…

Skip use of CDN near hosting region

The server hosting this domain is a VPS hosted in Switzerland by Nimag network SàRL. Access speed from Asia is pretty bad, specially due to network latency on the pipes Singapore-US and US-Europe. In using a CDN to serve assets, we improve global page loading time in lowering the loading times of assets. The VPS has a good European connexion, there is not much need for visitors in Europe to use a CDN.

Read More…