Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2015, 01:23 PM
asabet asabet is offline
 
Join Date: Dec 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to remove render-blocking javascript and optimize css in above the fold content?

Google's Page Speed Insights tells me the following:


I suppose a similar result would come for any vBulletin 4 site. Has anyone figured out how to:

A) defer or async the javascript so that it is no longer render blocking without breaking functionality

B) Inline and/or combine the mentioned CSS so that it is faster

Would appreciate some pointers.
Reply With Quote
  #2  
Old 01-13-2015, 01:28 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A) According to this, you need to add the async attribute to all script tag references. I'm not sure if that will work though.

B) You could merge a bunch of CSS templates together in vBulletin, but this may result in issues when a certain template doesn't load certain CSS templates.
You other options are:
- Use something such as Cloudflare or Incapsula to optimize your site.
- Minify your CSS templates, be sure to keep a copy of the normal beautified version of your CSS templates.
Reply With Quote
  #3  
Old 01-13-2015, 01:36 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
- Use something such as Cloudflare or Incapsula to optimize your site..
Those don't optimize anything and also add a significant amount of first byte time. They just try to load cached static content from a location closer to the user than the host is. If that content is fat, it will still be fat when it's delivered through a CDN.

To the OP: I don't use or recommend Google PageSpeed. Try http://webpagetest.org instead.
Reply With Quote
  #4  
Old 01-13-2015, 01:44 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
Those don't optimize anything and also add a significant amount of first byte time. They just try to load cached static content from a location closer to the user than the host is. If that content is fat, it will still be fat when it's delivered through a CDN.

To the OP: I don't use or recommend Google PageSpeed. Try http://webpagetest.org instead.
Well, I consider minifying of CSS/JS files and the HTML output as optimizing.
When I disable Cloudflare on my forum it loads slower than when it's enabled.

If OP wants another tip, optimize all of your images with https://kraken.io/web-interface (choose lossless unless you don't mind losing a bit of quality)
Reply With Quote
  #5  
Old 01-13-2015, 01:47 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
When I disable Cloudflare on my forum it loads slower than when it's enabled.
Is that subjective? Or objectively and scientifically tested? Because I bet when you use a browser that hasn't cached any of your content, you'll be really disappointed at how little CF helps you.

Go to webpagetest dot org and run the tests both ways to see what I mean.
Quote:
If OP wants another tip, optimize all of your images with https://kraken.io/web-interface (choose lossless unless you don't mind losing a bit of quality)
His entire page only loads around 540 kb. Pretty light as it is.






Meanwhile, again to the OP - At Ozzmodz we have a vBulletin optimization forum with actual case histories and actual results, how-to, and tips.

Here.
Reply With Quote
  #6  
Old 01-13-2015, 01:55 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
A) According to this, you need to add the async attribute to all script tag references. I'm not sure if that will work though.

B) You could merge a bunch of CSS templates together in vBulletin, but this may result in issues when a certain template doesn't load certain CSS templates.
You other options are:
- Use something such as Cloudflare or Incapsula to optimize your site.
- Minify your CSS templates, be sure to keep a copy of the normal beautified version of your CSS templates.
Be careful with Incapsula its quite annoying and can cause problems. I've had a client that had this installed and it was a nightmare to work with and get it uninstalled.
Reply With Quote
2 благодарности(ей) от:
CAG CheechDogg, Max Taxable
  #7  
Old 01-13-2015, 01:56 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

By the way, also to the OP - you have a flash object that is 14.5 percent of your pageload. If ever there was something that would interrupt, slow down or block render, it's a flash object. Especially a big one.

Just FYI.
Reply With Quote
  #8  
Old 01-13-2015, 02:12 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
Is that subjective? Or objectively and scientifically tested? Because I bet when you use a browser that hasn't cached any of your content, you'll be really disappointed at how little CF helps you.

Go to webpagetest dot org and run the tests both ways to see what I mean.His entire page only loads around 540 kb. Pretty light as it is.






Meanwhile, again to the OP - At Ozzmodz we have a vBulletin optimization forum with actual case histories and actual results, how-to, and tips.

Here.
I'm not going to scientifically test something just to prove a point. I simply checked the total loading time of all resources with and without Cloudflare (non-cached and cached versions). If your test results are different than mine then that's completely fine, but I will still be supportive of Cloudflare. On big forums every ms and saved kb matters.

Besides that I also use Cloudflare to prevent DDoS attacks (instead of buying an expensive server with DDoS protection), gaming forums are target for such attacks all the time. I used to receive attacks weekly but since I enabled Cloudflare, 2 years ago, I haven't received a single attack.

Quote:
Originally Posted by HM666 View Post
Be careful with Incapsula its quite annoying and can cause problems. I've had a client that had this installed and it was a nightmare to work with and get it uninstalled.
I have 0% experience with Incapsula so I'll trust your word.

@OP: if you want to optimize some more, you could consider using memcached for vBulletin, using MariaDB instead of MySQL and nginx instead of Apache.
Reply With Quote
  #9  
Old 01-13-2015, 03:16 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
I'm not going to scientifically test something just to prove a point. I simply checked the total loading time of all resources with and without Cloudflare (non-cached and cached versions). If your test results are different than mine then that's completely fine, but I will still be supportive of Cloudflare. On big forums every ms and saved kb matters.
Checked how? With your own browser and your own connection? Timed it how, with a stopwatch? We do objective and scientific tests not to "prove a point" but to learn objectively, what is really going on.

CF DOES increase first byte time, DOES delay the "handshake." All CDNs do. The CF people even admit it now after denying it, deflecting, making excuses and naysaying for over two years. It's the nature of the beast.
Quote:

Besides that I also use Cloudflare to prevent DDoS attacks (instead of buying an expensive server with DDoS protection), gaming forums are target for such attacks all the time. I used to receive attacks weekly but since I enabled Cloudflare, 2 years ago, I haven't received a single attack.
CF is a answer for a very small percentage of vBulletin installations. But it is NOT a answer to optimization. If your site is not optimized, CF and other CDNs don't do that for you.

I don't recommend CF or any other CDN as a broad brush, fix it quick, one size fits all solution. The OP is a good example - he's only delivering 540kb to browsers, he doesn't need a CDN. He needs actual optimization help. And at that, he really doesn't need much of it. His main issue is leveraging browser cache of static assets and that's a very simple thing to do with vBulletin on Linux.

I'm not trying to knock you Dave. You believe what you believe for the reasons you believe them and I respect that. But I've fixed dozens of really ill, truly sick, vB installations over the last few years and not one of them needed a CDN to do it. It's the last thing I consider when trying to help with actual problems for folks. Fix the basic stuff first.
Reply With Quote
  #10  
Old 01-13-2015, 03:23 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I mean, look at this test on the site in your signature which I assume is yours. You are failing both first byte AND leverage browser cache of static assets - and this is WITH the CDN active.

http://www.webpagetest.org/result/150113_NR_ZKE/

Turn off the CDN, and run this exact test again with the exact browser and location parameters you see there, and I guarantee your first byte time improves.

It's not subjective - this is a real world test with a real browser and a real internet connection.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:55 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04428 seconds
  • Memory Usage 2,279KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (10)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete