Ssl – Why is the site so slow after installing SSL

Apache2httpsperformancessl

I have a WordPress site that performs fairly well locally. Most pages load in at around 1s. Some are even less at around 800-900ms.

When I upload my site to my production server, a 2G RAM VPS on Digital Ocean, the load time goes up to about 1.6s, which isn't too crazy, but after I installed an SSL certificate, the loading time is now closer to 4-5s. That is a massive jump! The domain I'm using is:

https://eightysix.ca

I've minified all my assets and get a pretty decent score on page speed tests like Google PageSpeed, Pingdom and Gtmetrix, but the overall server response time has ballooned.

At first I tried using a paid SSL from GoDaddy but after seeing how slow it was, I tried installing a certificate from Let's Encrypt, which seems to be marginally better but still very slow.

I understand https will always be a little slower than http, but there shouldn't be this big of a difference. What causes the lag? Is there anything in my theme that I should be looking for? I'm using a lot of cURL requests to render SVG icons in PHP. Could this be the problem? Any suggestions would be greatly appreciated.

Update

After hearing from a few of you and reading up on it a little more, I've been given the impression that this kind of load time is to be expected when you're using HTTPS with WordPress and no cache plugin.

I've had terrible experiences with cache plugins in the past – not being able to turn them off in development – and so I was resisting using one, but I've since caved and installed WP Super Cache. I know this doesn't explain my issue, but it may have solved it. After a few page loads, the site is now loading quite fast.

Best Answer

Check out https://www.webpagetest.org/result/180412_67_0e179d6dfd05c65eafcd1bba968d5028/

It shows it's taking almost 4.6 seconds to do the initial page load. If you dig in; Time to First Byte is 4.3 seconds. That's wordpress generating the page.

Wordpress is the problem there, not HTTPS. If you're not using a caching plugin. (w3cache, wpSuperCache, etc) that would be the first thing I'd try.