Sunday, November 6, 2016

Main blog post thumbnail image firstImageUrl

Dreamhost secure CDN for Woocommerce Wordpress site

I was very pleased when Dreamhost built in free security certificates from the Let's Encrypt service. Here's a the Dreamhost and Let's Encrypt integration announcement.

Unfortunately, utilizing this meant you couldn't use the cloudflare service without upgrading. I decided to roll my own CDN to speed up my brother's stain glass shop's website. The page load speed dropped by almost 200% and site site feels speedy when browsing now.

After researching many solutions and option I settled on this solution. I didn't want using a CDN to exclude or confuse anyone (or any search engines) looking for our content. The CDN I created is all under our primary domain with canonicals pointing back to the original content to avoid any accidental duplicate content penalties by search engines.
  1. I created  3 secure CDN sub-domains and choose the free Let's Encrypt SSL certificate in Dreamhost hosting console to serve up our images, fonts, css and js.
  2. https://cdn.glasshousestore.com
    https://cdn2.glasshousestore.com
    https://cdn3.glasshousestore.com

  3. Create soft links to all the Wordpress assets /wp-content and /wp-includes from an SSH session. (ex. ln -s ~/glasshousestore.com/wp-content/ ~/cdn.glasshousestore.com/)
  4. Create a unique htaccess for the CDN's to handle font headers, canonical headers and redirects to the primary domain.

  5. Utilize WP Super Cache to rotate serving the various static content through the subdomains.
  6. Hope this helps someone to speed up their hard work on the internet.