“How can I use Amazon CloudFront as WordPress CDN? I want to speed up WordPress page load speed.”

There are a couple of ways you can approach setting up WordPress to use Amazon CloudFront as a CDN for WordPress, depending on how you want to approach it. The W3 Total Cache plugin will work for configuring WordPress to automatically put any files from your WordPress theme and upload directory to CloudFront. You can also manually upload files to CloudFront and link to them in your CSS and blog posts. Both options offer some advantages and disadvantages.

Using W3 Total Cache is the easiest way to configure WordPress to use Amazon CloudFront as your WordPress CDN. After installing the plugin, you give it your AWS credentials and setup the files you want served from CloudFront. W3 Total Cache then performs various operations like minifying .js and .css files on the fly as it serves them to website visitors. While this works easily, it’s not necessarily resource efficient. For most themes, you aren’t going to change the CSS very often. For JavaScript, minifying and compressing the files once is enough. There’s really no reason to need to create a minified version of the files on the fly, which adds to the work your web server is doing.

A more efficient approach may be to optimize all the files, reference the optimized files in your WordPress install, and only use W3 Total Cache as the easy mechanism for transferring the files over to CloudFront (at least for the file operations, there are other caching benefits to using W3 Total Cache). By doing a minify of the .js files and .css files ahead of time, you don’t need to convert them on the fly. You can also compress your files prior to sending them to CloudFront, which means your server doesn’t need to compress the files on the fly every time the resources are served.

It’s still a great idea to have W3 Total Cache minify your HTML on the fly, in combination with using mod_deflate on your server to compress pages on the fly, which translates to more efficient delivery of website resources.

Published On: March 14th, 2011 / Categories: Amazon Cloudfront / Tags: /

Subscribe To Receive The Latest News

Curabitur ac leo nunc. Vestibulum et mauris vel ante finibus maximus.

Add notice about your Privacy Policy here.