Sunday, February 25, 2024

AWS CF policy workflow

 


As outlined in the above diagram, response headers policies do not impact the origin-supplied headers stored in CloudFront’s caching layers. 

Headers configured in the policies are inserted after the response leaves the cache, and before the viewer response event that triggers a function if configured. 

If you have an edge function attached to the same behavior, policy inserted headers will be accessible in your function through the event object listing all the headers associated with the response. 

You can use that functionality by treating the headers generated through a policy as inputs for the function that will impact how the code is executed. This is similar to using environmental variables.

Sunday, February 18, 2024

MIME type text html

 


What

Last week, we faced MIME type error after the hosted server upgrade.  

Loading module from “runtime.4c09d92ae7f4a186.js” was blocked because of a disallowed MIME type (“text/plain”).  Strict MIME type checking is enforced for module scripts per HTML spec.

By design, Angular web app is hosted using AWS S3 and CloudFront architecture.

Where

These issues were related to three build files namely main.js, runtime.js and polyfills.js 

Why

Due to recent server upgrade process, Angular build files were uploaded into AWS to render as text/html by default. 

How

Fix is to upload files to s3 and specify the content-type in metadata for js files explicitly as below:

aws s3 sync $DIST_PATH/ s3://$BUCKET_NAME/ --include "*.js" --content-type "application/javascript"


Friday, February 9, 2024

Google Gemini

 


Yday, Google announced a major rebrand of Bard, its artificial intelligence chatbot and assistant, including a fresh app and subscription options. Bard, a chief competitor to OpenAI’s ChatGPT, is now called Gemini, the same name as the suite of AI models that power the chatbot.

Google CEO wrote in his note - "A new state of the art"

In December, we took a significant step on our journey to make AI more helpful for everyone with the start of the Gemini era, setting a new state of the art across a wide range of text, image, audio, and video benchmarks. However, Gemini is evolving to be more than just the models. It supports an entire ecosystem — from the products that billions of people use every day, to the APIs and platforms helping developers and businesses innovate.

The largest model Ultra 1.0 is the first to outperform human experts on MMLU (massive multitask language understanding), which uses a combination of 57 subjects — including math, physics, history, law, medicine and ethics — to test knowledge and problem-solving abilities.

Today we’re taking our next step and bringing Ultra to our products and the world.

Wednesday, February 7, 2024

AWS IPv4


Starting 1st Feb 2024, AWS Free Tier covers for Amazon Elastic Compute Cloud, 12 months free, to include 750 hours of public IPv4 address usage per month. 


AWS Free Tier for Amazon EC2 applies to in-use public IPv4 address usage. Usage beyond 750 hours per month of in-use public IPv4 address will be charged at $0.005 per IP per hour as announced in this AWS News blog. 


There is no change in pricing for idle public IPv4 addresses that you allocate in your account but don’t attach to an EC2 instance. IPv4 addresses that you own and bring to AWS using Amazon BYOIP will continue to be free.