Jump to content

Script or hook loading speed.


Recommended Posts

So, im messing around with my site to try make it load faster, and i noticed when i use the direct link to a language selection vs having the language hook i use find it, the load speed decreases significant..

 

Im using this code for language redirect

 

(look picture as this community is broken with post code!)

 

And it works fine, but look at included screenshot from GTMatrix (i did this many times to make sure), the load time for this one thing is crazy.

 

Anyone know a trick or fix to speed this up?

 

Thanks 🙂

languageselect.JPG

languageredirectphp.JPG

Edited by inTempo
code
Link to comment
Share on other sites

The reason why it loads slowly is that ClientAreaPage triggers when WHMCS has already initialized most classes and functions. That's why for example the $vars is not empty and can be used in the hook.

In essence when you use header location inside ClientAreaPage, you are effectively loading two pages at once. The one where the user lands and the target of your redirect.

You don't notice the first load just because there's no output but WHMCS has already autoloaded a ton of classes.

With .htaccess you avoid the redirect bottleneck.

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