• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defer helper output - possible?

I am still trying to optimise my site and noticed that my contact form's fileupload (fileinput.js from Krajee.com) causes a huge delay on the FCP time. This form however is below the fold and added where needed through a helper function.

The additional JS is what is slowing it down, if I remove it and use the fallback non-ajax upload I can improve FCP my about 2seconds.

So I was thinking why not just defer the loading of this form in the helper by a second or so to allow an immediate FCP and then lazy-load the form?

I have however no clue how I could do or how to the change the helper function to do so. 

Has anyone done a delay for the output (how?) or should I simply put the script part into an external JS and put that external js-file with a defer tag in the $return sting and see what happens?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.