Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Improve page load time
Jon_Simmonds
Join Date: Nov 2005
Posts: 103

 

UK
Show Printable Version Email this Page Subscription
Jon_Simmonds Jon_Simmonds is offline 01-28-2010, 10:00 PM

With google now apperently taking in page load time into account for rankings, and looking at the Labs > Site Performance link on Google Webmaster Tools, it says my forums were slow to load up I have spent the last few days looking at how to speed things up. Now while you can control what googlebot see's via robots.txt, the info uses to generate page load time appears to come from the google toolbar, which means all parts of your site visible to members have the page load time logged

I came across this article on vbulletin.org - https://vborg.vbsupport.ru/showthread.php?t=223251 and just have a few quick tips that can be done to help make things faster.

I have mainly focused on what can be improved in terms of vbulletins templates, rather than tinkering with servers etc, some of these were touched in the article I linked in above but I feel that I have added onto them, all of this I have found from researching the net/google/etc so I don't take any credit for anything!

While doing this, I found it relativly easy to improve on the forumhome & forumdisplay templates, though when it comes to showthread the biggest issue is images in your member's signatures - inactive members could have links to images that 404, others may have multiple images in theirs.

1) If using the Yahoo CDN to host the YUI libraries, then use Yahoo's combine function


In the header include template replace the following
Code:
<script type="text/javascript" src="$stylevar[yuipath]/yahoo-dom-event/yahoo-dom-event.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript" src="$stylevar[yuipath]/connection/connection-min.js?v=$vboptions[simpleversion]"></script>
with
Code:
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js&2.8.0r4/build/connection/connection-min.js"></script>
This only works on the Yahoo CDN for the YUI files, not for Google or from your own server, if you use other YUI libraries then you can use this page to add what libraries you need : http://developer.yahoo.com/yui/artic...-dom-event&MIN

Simple really, 2 http requests or 1 http request, for what is the same data, that will be called on every page. If you use a few mods check if they use any other YUI libaries and consider loading them in this way.

2. Improve the loading of CSS

Using store CSS as a file I then modified the code to make vbulletin treat the CSS via a link rather than import - http://www.vbulletin.com/forum/showt...import-vs-link

Depending on your style, you could consider combining the CSS into one, to save on http requests, but that really depends on how you have your style setup on your forums.

3. Make use of css image sprites
These can really make a difference to page load times, I found a great CSS sprite generator
at http://csssprites.com/ although I prefer to use <img> tags rather than <div>'s that the generator uses, so read this article http://cssglobe.com/post/3028/creati...ul-css-sprites and use the background position info from the genarator & the <img> tags suggested by the article

4. Turn of signatures for in-active members

Consider turning off signatures for members who haven't been active in X days by changing the following code in both postbit & postbit_legacy (well either/or depending on how you run your forums)
Code:
<if condition="$post['signature']">
<!-- sig -->
<div>
__________________<br />
<div class="hidesig">$post[signature]</div>
</div>
<!-- / sig -->
</if>
to
Code:
<if condition="$post['signature']">
<if condition="$post[lastactivity] > TIMENOW - X*86400">
<!-- sig -->
<div>
__________________<br />
<div class="hidesig">$post[signature]</div>
</div>
<!-- / sig -->
</if>
</if>
Changing X to a value in days

[EDIT]
Or for vbulletin 4.x use the following (Thanks to BBR-APBT for the code)
Code:
<vb:if condition="$post['signature']">
<vb:if condition="$post['lastactivity'] > TIMENOW - X*86400">
    <blockquote class="signature restore"><div class="signaturecontainer">{vb:raw post.signature}</div></blockquote>
</vb:if>
</vb:if>
[/EDIT]
Reply With Quote
  #12  
Old 04-10-2010, 05:36 AM
YankForum's Avatar
YankForum YankForum is offline
 
Join Date: Mar 2010
Location: MY
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great tips
tnxxxx
Reply With Quote
  #13  
Old 04-21-2010, 06:36 AM
samiro's Avatar
samiro samiro is offline
 
Join Date: Jan 2007
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
Considering this is in the vB4 section the correct if conditionals will be.
Code:
<vb:if condition="$post['signature']">
<vb:if condition="$post['lastactivity'] > TIMENOW - X*86400">
    <blockquote class="signature restore"><div class="signaturecontainer">{vb:raw post.signature}</div></blockquote>
</vb:if>
</vb:if>
its not working.
i set it to 100 days
and i can see sig' of users not been in the forum from 2009
Reply With Quote
  #14  
Old 04-21-2010, 09:55 AM
Kolbi Kolbi is offline
 
Join Date: Mar 2009
Location: D - S?dbaden
Posts: 899
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you changed the x to something else?
Reply With Quote
  #15  
Old 05-05-2010, 12:33 AM
slimgamer's Avatar
slimgamer slimgamer is offline
 
Join Date: Apr 2010
Location: HI
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for the idea & code! Implementing it on my test site to see how effective it is in my case.
Reply With Quote
  #16  
Old 11-29-2010, 07:15 PM
evo10 evo10 is offline
 
Join Date: Nov 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent
Reply With Quote
  #17  
Old 11-28-2012, 05:14 PM
moustafa moustafa is offline
 
Join Date: Oct 2008
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what codes to be replaced for Google CDN to host the YUI libraries?
Reply With Quote
  #18  
Old 07-21-2015, 03:54 PM
friendlymela's Avatar
friendlymela friendlymela is offline
 
Join Date: Dec 2012
Location: Karachi, Pakistan
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this was i needed .. thanks
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 09:10 AM.


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.04329 seconds
  • Memory Usage 2,276KB
  • Queries Executed 22 (?)
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
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete