Page load with wordpress
And load times with static files created by Jekyll:
The load time went from 2,04 seconds to 452 ms. It probably loads a bit slower if you do not block trackers.
When then switch to Jekyll was made I’ve also started to delete some Wordpress leftovers in the HTML-markup.
I also skipped the implementation of share buttons for the new site, i’ve never been a fan of their loading times so now I’m skipping them as a test.
I now also use an image lazy loader that is only using vanilla javascript, making it unnecessary to include jQuery or any other framework. That generates fewer bytes to download for the visitor.
I tried using the official tools to migrate posts and pages from Wordpress to Jekyll. That however left me with a lot of html-fixes to do in every post on the site. I ended up using exitwp instead. Still got to do some fixes, but a lot less of them.
You can use Github pages to host your jekyll site. A lot of people do this. But i decided to stay with my current host and got the opportunity to write my own deploy script :)
I thought I’d share it with you if you want to build your own from this template. It uses secure copy to upload the files to the server.
It also gzips every html, js and css asset before deploying. I got the script from Dominic Watson But changed it a bit to fit my site.
#!/bin/bash
ACTION='\033[1;90m'
FINISHED='\033[1;96m'
READY='\033[1;92m'
NOCOLOR='\033[0m'
echo
echo -e ${ACTION}Removing _site folder
echo -e =======================${NOCOLOR}
rm -rf _site/
echo -e ${FINISHED}Done.${NOCOLOR}
echo
echo -e ${ACTION}Building site
echo -e =======================${NOCOLOR}
echo
jekyll build JEKYLL_ENV=production
echo
echo -e ${FINISHED}Done.${NOCOLOR}
echo
echo -e ${ACTION}Compressing all Html, css and js with GZIP
echo -e =======================${NOCOLOR}
find _site/ -iname '*.html' -exec gzip -k -n {} +
find _site/ -iname '*.js' -exec gzip -n -k {} +
find _site/ -iname '*.css' -exec gzip -n -k {} +
echo -e ${FINISHED}Done.${NOCOLOR}
echo
echo -e ${ACTION}Transfering files to host
echo -e =======================${NOCOLOR}
echo
scp -r _site/*[!wp-content] user@host:/path/to/send/site/
echo
echo -e ${FINISHED}Done.${NOCOLOR}
echo
echo -e ${READY}Site deployed.${NOCOLOR}
echo
exit 0
scp -r _site/*[!wp-content] user@host:/path/to/send/site/
This line takes care of sending the files to the host. The [!wp-content] excludes that folder so that i won’t upload all the images every time.
Update: I now use rsync to transfer the files instead of scp.
To minify css and javascript i use the Jekyll assets plugin. And to minify the html i use the compress html layout by Anatol Broder.
I now also use Cloudflare to get hands on a free ssl-certificate that they also take care of renewing. All to get that marginal boost in the SERP.
I hope you find this post valuable. If you click the ad below I get paid by someone else and can continue to publish posts for free. I would appreciate it very much.