Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Step by Step guide to speed up your VB4 OR VB3
final kaoss
Join Date: Apr 2006
Posts: 886

by final kaoss final kaoss is offline 28 Jul 2011
Rating: (2 votes - 3.00 average)

There are several steps to improve your page loading speed. I will go over a few steps that will improve your site's loading time.

Step 1: Tweak your htaccess.
Open the htaccess file in your forum root and add the following below any url rewrite rules you may have from:
Vbulletin 3 or 4 with VBSEO installed
VB4 Forum Classic
VB4 Suite
VB3 by itself

This covers the following Pagespeed Rules.

Leverage browser caching
Specify a cache validator
Enable gzip compression

Make the following changes in your admincp


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This helps to cache nearly any file type that you may add in your attachment options (if you allow people to upload music files, zip files, rar files etc.. see the list lol)

*some people report login problems, I have posted below what works for me. Be sure to do this step as well to avoid problems!!
http://www.vbulletin.org/forum/showt...php?t=267588#3

Browse to the bottom of this first post for the .htaccess code.

Step 2: Combine Javascript and Minify Javascript & CSS and Minify HTML.
Not compatible with VB3

This covers the following PageSpeed Rules:

Minify HTML
Minify JavaScript
Minify CSS
Combine external CSS
Combine external JavaScript


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 3: Optimize images
There is no more need to do this for vb4 packages unless you wish to do this on other images such as avatars, custom buttons, attachments, gallery uploads etc.

This covers the following PageSpeed Rules:

Optimize Images

If you have access to Visual Studio 2010 (grab the trial edition here which should be compatible with the addon), you can complete this step in just a few clicks using this addon
http://visualstudiogallery.msdn.micr...77c3?SRC=VSIDE

You can also use pnggauntlet which will compress images as well.

This is great to use on new skins/themes and also non animated gifs for Smileys, Signatures, Photo Album & Group Images and Avatars that your forum stores on your server!

Please note that both of these methods produce lossless images, meaning that even though it uses various methods to decrease file size there is absolutely no visual loss in quality of the image.

For non-windows users, I suggest Imageoptim & Trimage

If you have alot of jpeg images, you can compress 10 per day with this jpegmini. Your other options with this tool are to upload jpegs to a jpegmini album which will compress the images for free which you can download soon after! Your other option is to buy the tool for $20, which will enable you to compress a unlimited amount of jpegs, although it won't compress images above 28 MegaPixels.



Optional Step 4: Add CSS Sprites.
Not compatible with VB3

This covers the following PageSpeed Rules:

Combine images using CSS sprites


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Optional Step 5: Use a CDN
Below are 3 free CDN's. I can vouch for cloudflare and google pagespeed service but have yet to try incapsula.

1) Incapsula
2) Cloudflare *Disable the Rocketloader feature to avoid potential issues.
3) Google PageSpeed Service *Recommended (Let it deliver js & css but not images!! You can and will lose your search rankings for images if you allow google pagespeed to deliver them!) Alot of benefits can be gained from using pagespeed service when it comes to pagespeed factors such as image dimensions are automatically added.

(Optional) Step 6: Make a free Server Optimization request

Now that you've done all of the steps above, there is one final thing left to do if you are using a vps or dedi, tweak the Server! You can go here to request a free tuneup:
http://www.vbulletin.com/forum/forum...-configuration

Here's one additional trick to help improve your seo btw:
[SEO Enhancement] Replace "reload this page" to the thread title [v1.00]

Enjoy!

Optional (Recommended) Step 7: Lazy load images.

Lazy Load will delay the loading of images outside of viewpoint to make the page load faster. That is, images in the visible part of the web page are only loaded and remaining images are loaded when visitor scrolls down the page, at some times it can even helps to save bandwidth.

Consider linking to us at http://video-game-chat.com/forum to help show your appreciation, since you'll be saving bandwith, reducing the loading time and thus keeping more visitors who visit your site. And impoving seo as google is now factoring in loading times into it's algorithms.

Test your page speed & yslow score's
If you would like to test your website and see what changes need to be made while you follow any part of this guide you can do so at several sites:

GTMetrix
Webpage Test
Pingdom

Here's a new htaccess that I've been testing, it's pretty solid so far. Simply throw in your url rewrite rules (for friendly urls).... this part may confuse people... they are usually located near the top of an existing htaccess file. Example...

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]

Throw that in between the #add your friendly url rewrite rules below. lines and your set! Another identifier is to look to see if the threads, forums, members etc are being affected by any rules in the old .htaccess... if so.. throw that in and you should have no problems.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by final kaoss : 19 Jan 2014 at 02:11. Reason: Revised the htaccess to make it fully compatible with any vbulletin setup
Views: 43000
Reply With Quote
Comments
  #2  
Old 28 Jul 2011, 23:48
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Real name: Brooks
Just a quick note, for the .htaccess, starting in 4.1.5

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

becomes

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time!"
"It's important to only think about what you desire, not what you fear to achieve your ultimate goal!!
Reply With Quote
  #3  
Old 29 Jul 2011, 00:15
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Fixing login issues with vbulletin 4.

found this recommendation about the login issue that you are experiencing. You may want to set the settings similar:
I would suggest you add your domains to your white list in vb options and then your cookies in vb and photopost set like this
cookie path /
cookie prefix bb
cookie domain .mysite.com
Example..
.www.video-game-chat.com

I have found that if I log into the front page the username is not showing at the top. However, if I login when checking a subforum, I am able to login successfully. I was also able to reply to the thread http://vgchat.info/forum/threads/166...me-3DS-Trailer without issues while being logged in.
Disable vbulletin content caching (since apache is handling that now)

AdminCP > Options > Server Settings and Optimization Options > Disable Content Caching: Set to yes

*Note these changes did not show immediately for me but they did show that they were working for me after roughly 15 minutes.

Last edited by final kaoss : 22 Apr 2013 at 19:16.
Reply With Quote
  #4  
Old 29 Jul 2011, 14:11
Dirt Bike Addict's Avatar
Dirt Bike Addict Dirt Bike Addict is offline
 
Join Date: Apr 2010
Real name: James
Originally Posted by extreme-gaming View Post
Remove a css request (results in a 404 anyways from gtmetrix tests)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Maybe rephrase that to only remove it if you haven't added any custom CSS.
Reply With Quote
  #5  
Old 29 Jul 2011, 14:12
final kaoss final kaoss is offline
 
Join Date: Apr 2006
True, most people however are unaware of it's presence.
Reply With Quote
  #6  
Old 29 Jul 2011, 19:33
Crotan's Avatar
Crotan Crotan is offline
 
Join Date: Feb 2010
Thanks, will be keeping an eye on this article, I just started tweaking my htaccess file for cache and wanted to look into compression as well.

Question though:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What is this and where does it display?

Also does this require enabling mod rewrite friendly urls? in the admin control panel
__________________
Reply With Quote
  #7  
Old 29 Jul 2011, 21:00
final kaoss final kaoss is offline
 
Join Date: Apr 2006
That set's the etags.

And this part identifies what set it (can be changed) Header set X-Powered-By
Run a test at http://gtmetrix.com, click timeline, expand an element and you will see details about that request including X-Powered-By

No, it doesn't require enabling friendly urls in the admincp. You can still take advantage of the seo friendly urls by selecting this option in your admin cp.

Mod Rewrite Friendly URLs

Last edited by final kaoss : 30 Jul 2011 at 00:54.
Reply With Quote
  #8  
Old 30 Jul 2011, 07:27
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Real name: DRE
I set up Cloudflare last week.

I'll do the Supercharged mod today. I already have mod-rewrite friendly urls.
__________________
www.8thos.com
www.qapla.com
Reply With Quote
  #9  
Old 30 Jul 2011, 18:49
Crotan's Avatar
Crotan Crotan is offline
 
Join Date: Feb 2010
I think the caching of javascript doesn't play well with the login systen, in Firefox4 and IE9.

People will log in, it'll display the thank you for logging in, and then they will come back to a page that appears to have them not logged in. Either the caching or the compression not sure which.

Chrome seems to be unaffected
__________________
Reply With Quote
  #10  
Old 30 Jul 2011, 18:52
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Real name: DRE
Originally Posted by Crotan View Post
I think the caching of javascript doesn't play well with the login systen, in Firefox4 and IE9.

People will log in, it'll display the thank you for logging in, and then they will come back to a page that appears to have them not logged in. Either the caching or the compression not sure which.

Chrome seems to be unaffected
Yeah it's doing some weird stuff on my forum. I had to disable twitter style login.
__________________
www.8thos.com
www.qapla.com
Reply With Quote
  #11  
Old 30 Jul 2011, 19:06
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Hi crotan, is this with vb supercharged installed or did you install the htaccess only? I would have to say caching is the issue here imho.

Originally Posted by Crotan View Post
I think the caching of javascript doesn't play well with the login systen, in Firefox4 and IE9.

People will log in, it'll display the thank you for logging in, and then they will come back to a page that appears to have them not logged in. Either the caching or the compression not sure which.

Chrome seems to be unaffected

Last edited by final kaoss : 30 Jul 2011 at 19:14.
Reply With Quote
  #12  
Old 30 Jul 2011, 19:17
Crotan's Avatar
Crotan Crotan is offline
 
Join Date: Feb 2010
Originally Posted by extreme-gaming View Post
Hi crotan, is this with vb supercharged installed or did you install the htaccess only? I would have to say caching is the issue here imho.
just the htaccess on post #3, since I'm on 4.1.5
__________________
Reply With Quote
  #13  
Old 30 Jul 2011, 19:21
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Try removing these lines from it

AddType application/x-javascript .js
ExpiresByType application/x-javascript A31536000

Also, change this line

<FilesMatch "\.(css|js|CSS|JS)$">

to
<FilesMatch "\.(css|CSS)$">
Reply With Quote
  #14  
Old 30 Jul 2011, 19:29
Crotan's Avatar
Crotan Crotan is offline
 
Join Date: Feb 2010
Seem to still have issues, I took out


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is now only.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

from the original


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But still this htaccess interferes with the login of users on IE and Firefox :/
__________________
Reply With Quote
  #15  
Old 30 Jul 2011, 19:30
final kaoss final kaoss is offline
 
Join Date: Apr 2006
ok. At least now we know that caching isn't the issue here. Actually... first... I want you to clear your browser cache and try again with those lines removed.
Reply With Quote
Reply


Similar Article
Article Author Type Replies Last Post
Use Google Custom Search In Navbar - Step By Step rajubd vBulletin 4.x Template Modifications 89 03 Jun 2013 15:45

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 18:49.

Layout Options | Width: Wide Color: