Jump to content

The way WHMCS handles 404 is not ok


Kian

Recommended Posts

I can't say that this is a bug but for sure it's something that should be looked into since it can hugely increase page loading times.

Every time WHMCS can't load a file it triggers a 404 which is perfectly normal. The problem is that every 404 loads the entire website (header, navbar, sidebar, body, footer and all the related action hooks) just to display the "Oops, page not found". Let me show how this could lead to severe issues. In the example below I have intentionally removed 5 images from a module that I'm creating so that WHMCS triggers six 404 (5x for images 1x favicon.ico).

intentional.thumb.png.33c4241fcd2eb995940e98a9fc893457.png

The website finished loading in 184ms but missing files increased this value up to 7173ms (+3800%) just because I removed 6 images. As I said earlier, the reason is that each 404 loads clientarea page. In other words on every page load you'll load clientarea 6 times because of missing files even when you're browsing the admin interface of WHMCS. Of course missing files should be fixed upfront but handling 404 in this way in my opinion is inefficient especially because the only purpose is to display the beautiful "Oops, page not found" page.

I want to underline that Firefox always requests favicon.ico file on every page view (that was a design decision). As we all know WHMCS doesn't have a favicon.ico file therefore every time we load a page WHMCS "secretly" loads clientarea (hooks, navbar, sidebar, body...) increasing loading times for no reason even if you have no missing files at all.

Edited by Kian
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated