I am working through docs on gohugo.io and the page loads are pretty slow - site-wide. Any idea why this would be? Compare it with another hugo site - smashingmagazine.com is extremely fast - and has much more media and is a larger site. Both sites are hosted on netlify.
I think it’s mostly a DNS issue. Which is known and has a known fix – I pinged @spf13 about it some time ago, but have forgot to follow up.
Where in the world do you surf from?
Hey, I’m in Jacksonville, Florida. Hmmm, gohugo.io being so slow is not a good representation of what people should expect from performance, and, somewhat painful to navigate for users. Hopefully he gets a little time to sort it out. I believe he has a lot of things going on, so this may not be a priority.
I have resent the mail I sent to him … But note that I have browsed the Hugo docs here from Norway plenty, and I have not thought about it as slow, so I guess there are variations here.
Thanks for your feedback about the likely DNS issue.
Steve got back to me quickly and said he now has done the DNS changes. I still see the weird traceroute across the Atlantic, but I guess it may take some time to have effect. Basically it meanst that Netlify should now handle it.
- From Thailand the page is very fast. Maybe last night (or day, depending on your timezone) the network was slow or the DNS fix did really something.
- Hugo has nothing to do with how fast the website loads. The performance of Hugo is in the building of the site.
- smashingmagazine.com wrote about how they improved their site speed. Lot’s of web workers and scripts and stuff below the first scroll is post-loaded. I can’t find that article, but it probably hides somewhere here: https://www.smashingmagazine.com/category/redesign
Open your browser console and check it out. Gohugo.io (pages in the documentation) loads after 2.3 to 2.5 seconds. everything. SM loads everything after 9 seconds.
What you feel as slowness is probably only what we call the time to first pixel (or something like that). Speeding that up might be mainly a themeing issue. Move CSS into two stylesheets, one for above the page break, the other with “all else”. Moving scripts around. Setting scripts up so that they are loaded after the page is loaded (in my theme I have a 5 line script that loads all js components 2sec after the DOM is loaded. This way my site comes up quite fast.
Adding some hard core caching (css and js and assets are produced with a hash in the filenames so I let them cache forever) and it feels fast again.
Thanks, the site is much faster now.
Great. I noticed it myself on mobile today. I guess now Netlify can pick the CDN closest to you.
I think in general the Hugo site is in decent shape in this deparment (re. cache headers etc.), and we will probably think harder about this once we do a docs rewrite. I have been waiting until I get “pages from data” out the door, so we could possibly clean up and autogenerate much of the API docs (e.g. the template funcs).