2

I'm trying to optimize the speed of my portfolio site as much as possible, which considering its a static website shouldn't take much.

I'm using cloudflare to manage my DNS, DigitalOcean's droplet to run NGINX, express to serve compiled Jade/Stylus files as HTML/CSS.

When I use a tool like pingdom to measure the time it takes for requests, I find that the DNS lookup takes 0.2s and the server takes 0.1s

https://i.imgur.com/vxCFFXt.png

When using GTMetrix, its a bit of a different story, it takes dramatically longer for the wait period.

enter image description here

Despite running all my images through a CDN, caching all my pages - using prerender; I find that a lot of sloppy websites with almost no optimization, load in a similar time to mine, with much larger page sizes (1.7mb vs my 240kb)

One thing that could be happening is that my server is somehow overloaded by a request and so it takes a little longer to serve a page. Or I'm not properly caching my files. Either way doesn't explain the 200ms DNS lookup. And when retesting my site on pingdom I somehow drop all the way down to 20ms wait times too. But DNS lookup times of 200ms are constant.

I have an AAAA record pointing my ipv6 address to my domain, an A record pointing my ipv4 address to my domain, and some additional A records pointing to subdomains, while my only 2 CNAMEs point to email subdomains.

2

Turns out that I had cloudflare proxy enabled on my A records, bad idea because it added bloat to my TTFB.

  • Ironically, CloudFlare says to not worry about TTFB. Not sure I trust them on that though. – Maximillian Laumeister Dec 3 '18 at 5:53
  • 1
    Yeah I read that article, it felt a lot like PR backtracking. I reduced my page load speed from 2s+ to just 1s by not using their proxy servers, whether or not TTFB is a big deal to them is irrelevant when I saw an actual quantifiable improvement by worrying about it. – nine Dec 3 '18 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.