I think I have redesigned this website for the third time. I keep changing the frameworks and services for speed and experience, change is for good!
First came the Github
The first version was based on pure Jekyll and was hosted on Github, using Cloudflare as CDN. Although both provided good performance, there was a huge issue I had when using free SSL certificates provided by Cloudflare. Github is not yet configured well to work with HTTPS on custom domains. We already aware of the fact that Github pages do not provide any way to configure and control the headers and redirections and therefore on using external services make it even worse.
The problem I had was like this: If a user goes to such a link:
When hosted on Github, it will get redirections as:
- http://ramdeoshubham.com/beginning-java [Request]
- https://ramdeoshubham.com/beginning-java 
- http://ramdeoshubham.com/beginning-java/  [WHAT!]
- https://ramdeoshubham.com/beginning-java/ [Final]
Look at the redirection 2 to 3. This is no point for that. First, the redirection takes the service from HTTPS to non-HTTPS, and second, having so many dangerous redirects has its own SEO issues too.
Github pages build Jekyll safe with –safe option, which does not allow the use of any external Jekyll plugins. Which takes away half of the Jekyll’s awesomeness!
The heavy head Wordpress
I quickly moved the content of the site to my shared hosting servers and set up a Wordpress site with a customized twenty-seventeen theme. I added W3 Total Cache plugin, Cloudflare CDN, and need to use a lot of security and control plugins.
Being a geek, I was not at all satisfied with an Automated Website. My reasons were simple. I need full control over each and every code of my webpage source. It should be as light as possible. I should be able to customize it without following any rules of the platform. Maybe I actually loved Jekyll more. But the problem with SSL I was having kept me confused for a couple of months.
Netlify to rescue!
I had created my account on Netlify more than a year ago. But don’t know why I kept ignoring it. It was probably a random ad I saw and got hit to try it.
Netlify is simple! I just added my Github repository itself, configured the custom domain and it got to build. That’s it.
Yes! With Netlify you get a lot of extra features like:
- Free SSL certificates
- Custom Domain and Subdomains
- optional Netlify DNS
- Resource Optimisation
- Can use external Jekyll Plugins
A lot more, and this all much for FREE!
I was really surprised when I tried and tested to see all that was really free!
I switched to Netlify DNS, removed the site from my server and quickly redesigned the site.
My pages went from 3 MB to 350 KB. Loading time from 5 seconds to 500 ms! Having a site in control feels like a superpower to a geek!
Static site the better way!
Well, there is no best way to host your static site because there are many services with great opportunities and features competing edge to edge. But for me at least, I find this route the best!
- Keeping your source code of the site on Github.
- Building the site with Jekyll and it’s awesome external plugins.
- Hosting the site through Netlify, with their DNS. It’s fast enough.
As from today onwards, we are now officially hosting all new site. There is a lot of content to be published. So stay Connected!