Optimization Tip: Careful with What You Are Loading on Your 404 Pages
Sometime ago I started trying to optimize the performance of DailyBlogTips, and during certain times of the day (i.e., peak hours) traffic was high and the responsive time was pretty awful.
I started by changing my cache plugin, removed unnecessary plugins and optimized the options table, and then I closed comments on older posts.
Despite that the site was not loading as fast as it could, so I started exploring what could be the issue.
By checking the CPU usage I realized that my 404 pages, which I happen to serve a lot for some reason, were consuming a lot of resources.
When I went to see what I was displaying there sure enough I found the problem: many years ago (i.e., 3 or 4) I had this idea that it would be cool to display my whole archive of posts in the 404 pages, so that a lost user could easily browse around. By that time I had 400 or so posts, and the site was smaller, so this didn’t wasn’t causing any server problems.
But these days I have close to 2,000 posts, and the traffic increase as well, so serving all those links every time a 404 page needed to be served was killing my server. I changed that to a simpler 404 page containing just an error message and the difference was noticeable.
I know you are probably not loading 2,000 links on your 404 pages, but even small script or plugin calls could cause a problem, especially if you get many 404 errors (this tends to happen if you have a lot of backlinks, as people often link to the wrong URL).
So double check to make sure your 404 is lean and mean.
Browse all articles on the WordPress category
12 Responses to “Optimization Tip: Careful with What You Are Loading on Your 404 Pages”
Wow. Very timely. I was modifying my 404 last night. Your tips would surely make my website load faster.
By the way, I just enrolled on your adsense course and yup, I love it!
I am also facing server load problem on Hostgator and they recently closed my account and told that i will have to disable all plugin then only they will activate my account, and now I am running without any plugin. And loosing lots of function and I am also not facing any 404 errors !!
Wow, that’s a lot of posts then! Glad you found it.
I just checked mine and I could see that its loading a huge list of posts as well so this post gave me an idea of revising my own 404 page.
Often overlooked but very important, just checked mine and I’m safe.
I find it so painful knowing that people have come to my site via a faulty link which I can’t correct. If they’re new to the site they tend to click off and you’ve lost an opportunity to gain a subscriber.
Reducing the load time of your 404, as well as presenting links to content in the sidebar or even suggestions generated from the attempted url (not something I’ve tried yet but seems like a great idea..?) is definitely the way to go to try and get some of the visitors from faulty links to stick around.
Very helpful one. It’s awesome. Thanks for shearing with us.
Some very crucial information, Daniel.
I heard(read) 404 pages should be more of a presentation type thing by keeping it to a minimum. Like a welcome page.
I also thought it was 300 or 301 pages that were mainly used to redirect visitors to your target address. With the benefit of having a nice and presentable entry page, rather than a big “the page you are searching for does not exist” greeting them at your front door.
Anyway, as far as loading speed, your site is not too bad compared to a few other Authority(Large and popular) blogs and websites I visit.
Some take forever to load up.
There are many sites that will not even load, period!
Other sites, even website up on page one, can not even be accessed from Google search results when you hit their url(site Address).
They go into a loop.
There’s a lot of buzz out there today about 404 error pages. Hmmmm…
Leif G.S. Notae
Good tip here. I can say I got fancy with my 404’s way back in the day, but now I just have them redirect to the main page. That might be making me a little slower, but then it is on my short story/flash fiction blog so I am not too worried.
Thanks for sharing this!
I don’t have any unnecessory things anf my 404 pages. Thanks Daniel for your article
Great tips. Yes, I saw your earlier 404 page where you put up all your blog archives. Not, it looks clean shaved.
# My blog has a search box. Is that fine or shall I remove it?
# what exactly causes 404 page? As you said this happens due to backlinks? You mean backlinks from external sites ?
# How can you determine 404 page error from your CPU usage? Any technique or just guess work?
Anyway, once again good tutorial. 🙂
I’ve seen some people load videos or massive graphics on their 404 page – while it can look pretty cool it seems to be a waste of loading time. By all means include a humorous image/message but don’t make me spend 5 minutes loading your page to find out I clicked on a dead link!
Comments are closed.