Boosting Performance: CloudFront KeyValueStore Optimization

AWS are pleased to present CloudFront KeyValueStore, a safe, low-latency global key value datastore that can be accessed readly from within CloudFront Functions. This feature enables highly customized logic to be implemented at CloudFront edge locations.

Information for choosing which URL to send the viewer to when a URL needs to be redirected. Every tiny change in configuration when embedding it with the function code necessitates a code change and a redeployment of the function code.

There is a chance that code will be accidentally altered when new lookup additions need updating and deploying code. Additionally, since the maximum function size is 10 KB, many use cases will struggle to fit all of the data within the code.

You select Functions from the navigation pane in the CloudFront dashboard. Then now you select Create KeyValueStore under the KeyValueStores menu.

This allows you to import key-value pairs into an Amazon Simple Storage Service (Amazon S3) bucket from a JSON file. If you want to start with no keys, therefore you not doing that right now. You finish the key value store creation by entering a name and description.

You select Edit under the Key value pairs area and then Add pair once the key value store has been established. You enter Hello World for the value and hello for the key before saving the adjustments. For now, one key is sufficient, but you can add more keys and values.

You select Functions from the navigation pane in the CloudFront console, followed by Create function. You give the function a name, choose the cloudfront-js-2.0 runtime, and finish the function’s creation. Then you correlate this function with the key value store using the newly available option.