2

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.

Michael Lynch
  • 121
  • 1
  • 1
  • 3
  • Watch the performance metrics on the server. Watch the CPU/Memory/etc (maybe start top/htop) make a few requests. What is hitting 100% What process? Fix that. – Zoredache Apr 12 '18 at 19:57
  • Definitely time to look at what's going on, on the server. The [timings](https://i.stack.imgur.com/uJkQZ.png) show very little of the time is due to TLS. What other changes have you made? – Michael Hampton Apr 12 '18 at 20:01
  • The main time is spend generating the HTML page on your site which has nothing to do with making the site accessible by HTTPS. Doing curl requests inside your application has also nothing to do with making your site accessible by HTTPS, i.e. no changes should be needed in these curl calls in the first place. Thus, there must be some other changes you did apart from making the side accessible by HTTPS. – Steffen Ullrich Apr 12 '18 at 20:12
  • Literally nothing has changed. Without SSL, one of the page renders in 1.6s. With SSL, it's closer to 5-6s. Same exact codebase. I'm using Wordpress actions and Twig to render the HTML templates (using the .twig extension of course). Could that be part of the problem? – Michael Lynch Apr 12 '18 at 20:22
  • Seems unlikely they'd have anything to do with it. – ceejayoz Apr 12 '18 at 20:31
  • Did you write this theme yourself? Consider [profiling](https://sandro-keil.de/blog/2015/02/10/php-profiling-tools/) to see where your bottleneck is. – Michael Hampton Apr 12 '18 at 20:59

1 Answers1

2

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.

txyoji
  • 385
  • 6
  • 13
  • Wordpress is not really the problem. The default theme loads much faster, though it's much lighter to begin with. My theme is using Wordpress actions and Twig to render templates. Could that be part of the problem? – Michael Lynch Apr 12 '18 at 20:20
  • If you tried another theme and it changed the results then you've narrowed it down. If at all possible, add a server-side caching layer on top of that ( wp cache plugin of some flavor ) so wordpress doesn't have to render the page on every page load. – txyoji Apr 12 '18 at 20:54
  • Also noticed that wordpress is sending cache control headers. (pragma no-cache) That will force all content to be re-loaded on every request. https://wordpress.stackexchange.com/questions/167128/prevent-wordpress-from-sending-cache-control-http-header#167162 – txyoji Apr 12 '18 at 21:01
  • I've had terrible experiences with cache plugins that aren't able to be turned off (i.e. GoDaddy), so I've been resisting installing one, but I just did and after a few page loads, the site loads really fast. I guess caching plugins are required for Wordpress sites these days... – Michael Lynch Apr 12 '18 at 21:13
  • @MichaelLynch wordpress has never really performed well without caching. – jordanm Apr 13 '18 at 01:13