Sunday, March 27, 2022

AWS CF compression


 

AWS CloudFront (CF) automatically compresses certain types of objects (files) and serve the compressed objects when viewers (web browsers or other clients) support them. Viewers indicate their support for compressed objects with the Accept-Encoding HTTP header. CloudFront can compress objects using the Gzip and Brotli compression formats. When the viewer supports both formats, CloudFront prefers Brotli.

Chrome and Firefox web browsers support Brotli compression only when the request is sent using HTTPS. These browsers do not support Brotli with HTTP requests.

When requested objects are compressed, downloads can be faster because the objects are smaller—in some cases, less than a quarter the size of the original. Especially for JavaScript and CSS files, faster downloads can result in faster rendering of webpages for your users. In addition, because the cost of CloudFront data transfer is based on the total amount of data served, serving compressed objects can be less expensive than serving them uncompressed.

CloudFront only compresses objects that have one of the following values in the Content-Type response header:

  1. application/dash+xml
  2. application/eot
  3. application/font
  4. application/font-sfnt
  5. application/javascript
  6. application/json
  7. application/opentype
  8. application/otf
  9. application/pkcs7-mime
  10. application/protobuf
  11. application/rss+xml
  12. application/truetype
  13. application/ttf
  14. application/vnd.apple.mpegurl
  15. application/vnd.mapbox-vector-tile
  16. application/vnd.ms-fontobject
  17. application/xhtml+xml
  18. application/xml
  19. application/x-font-opentype
  20. application/x-font-truetype
  21. application/x-font-ttf
  22. application/x-httpd-cgi
  23. application/x-javascript
  24. application/x-mpegurl
  25. application/x-opentype
  26. application/x-otf
  27. application/x-perl
  28. application/x-ttf
  29. font/eot
  30. font/opentype
  31. font/otf
  32. font/ttf
  33. image/svg+xml
  34. text/css
  35. text/csv
  36. text/html
  37. text/javascript
  38. text/js
  39. text/plain
  40. text/richtext
  41. text/tab-separated-values
  42. text/xml
  43. text/x-component
  44. text/x-java-source
  45. text/x-script
  46. vnd.apple.mpegurl

Ultimately, I realize a significant performance improvement on leveraging AWS CF compression.

Saturday, March 12, 2022

AWS CF vs TF

 


AWS CloudFormation (CF) is an infrastructure templating, or infrastructure as code (IaC) service provided free of charge by AWS. HashiCorp Terraform addresses similar needs, including an IaC declarative approach, but in a cloud agnostic way.

Terraform (TF) is an open source product first released by HashiCorp in 2014. Like all open source, this means limitations are out in the open (security or otherwise), and high priority changes/fixes can be made by the public if needed.

CloudFormation is a free but proprietary SaaS offering.  The implementation is not available for examination or modification except by Amazon staff.  Like all traditional software products, this means that the quality of the underlying implementation is a trade secret of AWS, and change prioritization is set by AWS.

Comparison chart is attached in the blog title image.  It's up to you and your business to choose the appropriate cloud automation framework based on your enterprise needs.

Saturday, March 5, 2022

AWS .NET 6


Start of 2022, Microsoft announced .NET 6, which has the advantages of new .NET language features and performance optimizations. Ref: https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6

Last week, AWS Lambda started to support .NET 6 as both a managed runtime and a container base image. Developers creating serverless applications in Lambda with .NET 6 can take advantage of new features such as improved logging, simplified function definitions using top-level statements, and improved performance using source generators.

To build and deploy Lambda functions using .NET 6, use the .NET Core CLI, AWS Toolkit for Visual Studio, or AWS Serverless Application Model (AWS SAM). Additionally, you can also use the AWS-provided .NET 6 base image to build and deploy .NET 6 functions using a container image. To migrate existing Lambda functions running earlier .NET versions, see the blog post linked above.

.NET 6 is the latest long-term support (LTS) release of .NET and will be supported for security and bug fixes until November 2024. AWS will automatically apply updates to the .NET 6 managed runtime and to the AWS-provided .NET 6 base image, as they become available.