How to use Amazon Cloudfront to speed up your wordpress site.

There are two ways for Cloudfront to work.
1. You upload all your wordpress static files (you wp-content and wp-includes folders) onto Amazon S3, then tell Cloudfront to get your files from Amazon S3 as it needs them.
OR
2. You tell Cloudfront to get the files directly from your site as it needs them. This second way is called ‘Origin Pull’.

The advantage of 1 is that if you ever change your wordpress host, your entire wp-content folder is stored off-site at Amazon S3, so you don’t need to even copy your wp-content folder to your new wordpress installation. The new S3 wp-content folder becomes your wp-content folder – you can even load images directly to S3 and then insert them into your wordpress posts.
The advantage of 2 is that it’s easier and cheaper, and you don’t need to upload the files to Amazon each time you make a new post.

Full-Site Delivery with Cloudfront

Cloudfront is a CDN designed for global content delivery. However, recent improvements allow it to act not only as a CDN, but also as a cache similar(ish) to Varnish.

People originally had to use Cloudfront by uploading their media to Amazon S3. Cloudfront then served those static assets from the S3 bucket. This means that within a coded application, developers needed to upload assets to S3 and then point URLs within their HTML (and perhaps in user-generated content) to a Cloudfront URL.

.. For instance, if you have a file example.com/css/styes.css, your Cloudfront URLabcxyz.cloudfront.net/css/styles.css will grab example.com/css/styes.css and then serve a cached version of that stylesheet for future visitors.

Within your own HTML, of course, you set the URL of styles.css to be your Cloudfront URLabcxyz.cloudfront.net/css/styles.css.

zxcvbn-async.min file is loading for all pages

PR doesnt register that script so it wont help whether you use an older version or newer version. the problem the way that script is being registered is wrong. You can however deregister, register again and enqueue back the script.

add_action('wp_enqueue_scripts','zxcvbn_script_fix',1);
function zxcvbn_script_fix(){
    wp_deregister_script( 'zxcvbn-async' );
    wp_register_script('zxcvbn-async', '//YOUDOMAIN.com/wp-includes/zxcvbn-async.min.js',array(),'1.0');
}