Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles

Reply
 
Thread Tools
YSlow Improve vb load speed v1
fxdigi-cash
Join Date: Jul 2012
Posts: 674

 

Show Printable Version Email this Page Subscription
fxdigi-cash fxdigi-cash is offline 06-30-2013, 10:00 PM

Good day, mates,

This is a just a beginning of my journey to optimize vb to the max and possible load speed...

INFO: :
------------------------------------------------
This little code can increase both load speed and vb pages performance...

It works on all vb versions starting from vb3.x.x till vb5...

Read more about Yslow link

Note:
The first release to page optimization code v1

Installation:

All you have to do is copy the code below and add it to your .htaccess in the vb root,

make sure to test your vb load speed before doing that in order to know whether you did the above step right or not...

sites to test your vb load speed:

1- http://gtmetrix.com/
2- http://tools.pingdom.com/fpt/
3- Google Speed test

The code:
PHP Code:
<IfModule mod_headers.c>
    <
FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$">
        
Header set Last-Modified "Mon, 15 Feb 2013 00:00:00 GMT"
    
</FilesMatch>
</
IfModule
Uninstallation:
All you need is to remove the code if you didn't want to use it anymore.

make sure you take a copy of your .htaccess before you make any modification.


Please make as installed if you used it....

Thanks,
Reply With Quote
  #32  
Old 07-04-2013, 11:23 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fxdigi-cash View Post
it is a good start, possibly there is something else needs to be addressed in your codes such as css and js order arrangement or compressing images .....

you can upload an image here you use on your forum to show you how far I can shrink its size...
Why not just show us all! lol
Reply With Quote
  #33  
Old 07-04-2013, 11:35 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

using one of the tools provided in my article can do this easily as this picture of pngauntlet demonstrates. Sometimes there is not much gain but other times you can shave off quite a huge number of KB's from images.


Here's a sample image from my own usage of the tool:
Attached Images
File Type: jpg pnggauntlet-savings.jpg (86.7 KB, 0 views)
Reply With Quote
  #34  
Old 07-05-2013, 09:23 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by final kaoss View Post
Yes I can agree with that, that a cdn is not for everyone. I personally find them to be the most effective with vbulletin when they are only set to serve javascript & css.

If you use the visual studio plugin provided along with the free trial of VS, you can shave off kb's from images without changing the file extension and after that then yes, you most certainly can use sprites.
well said. Yes, true CDN is going to be the 1st choice for anyone who wants to pay, but CloudeFlare offers a free subscription, which is good to start with. I believe they are decent to some level. I might consider their paid service near future.

For sprites, the story is very long and it depends on how you divide your css to many or only one file. if one file then taking all images in consideration to use only one sprite would take long time especially if your forum is full of custom images...
Reply With Quote
  #35  
Old 07-05-2013, 09:31 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by addamroy View Post
Why not just show us all! lol
I would love it, but first I want to see the challenge and increase the excitement...

Ok, here is an image attached original and after shrinking in size...

notice that before.png is 1.3kb with 12x12px and then after compressing it (and renamed it as well), after.png is 429kb with 12x12px.....

for instance, it is much better than any compression tool... what you think???

perhaps I will open a topic for this just to avoid the distraction...
Reply With Quote
  #36  
Old 07-05-2013, 09:33 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by final kaoss View Post
using one of the tools provided in my article can do this easily as this picture of pngauntlet demonstrates. Sometimes there is not much gain but other times you can shave off quite a huge number of KB's from images.


Here's a sample image from my own usage of the tool:
I like this tool, but still the one I use is away much better... let's test it and see more...
Reply With Quote
  #37  
Old 07-07-2013, 08:45 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Moved to articles, this is not an add-on.
Reply With Quote
3 благодарности(ей) от:
Delfi_r, final kaoss, fxdigi-cash
  #38  
Old 08-11-2013, 05:43 PM
leanbulk leanbulk is offline
 
Join Date: Jul 2007
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this not work with vbseo? It actually slowed me down...

HTML Code:
# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

<IfModule mod_headers.c> 
    <FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$"> 
        Header set Last-Modified "Mon, 15 Feb 2013 00:00:00 GMT" 
    </FilesMatch> 
</IfModule>  

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*\.php(/.*)?)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]

#php_value display_errors on
#php_value error_reporting 1
Reply With Quote
  #39  
Old 08-17-2013, 07:14 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it should be working on all vb versions without any exception. you can post your site link or a test for it using http://gtmetrix.com to see what the issue is...


Quote:
Originally Posted by leanbulk View Post
Does this not work with vbseo? It actually slowed me down...

HTML Code:
# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

<IfModule mod_headers.c> 
    <FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$"> 
        Header set Last-Modified "Mon, 15 Feb 2013 00:00:00 GMT" 
    </FilesMatch> 
</IfModule>  

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*\.php(/.*)?)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]

#php_value display_errors on
#php_value error_reporting 1
Reply With Quote
  #40  
Old 08-19-2013, 08:13 PM
tommythejoat's Avatar
tommythejoat tommythejoat is offline
 
Join Date: Apr 2008
Location: Boston
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fxdigi-cash View Post
Hi Nirjonadda

I can't make a plugin just for such a simple code... I have many reasons why...

1- Plugins decrease vb performance and effect on the speed load.
2- it may cause a conflict with other plugins or codes, that's why adding a code directly to .htaccess is a lot better and easier.

besides, I want to reduce the number of used plugin instead of increasing them since they are big issue on vb load speed... codes are always better for performance and speed ....

Cheers
Could you tell me how plugins increase load time? Our computer executes pretty fast and the additional envelope to get to the plugin code is small, is it not?

Are you saying that if I removed all the hooks in the vBulletin php files and replaced them with the set of plugins that execute under those hooks then the site would run faster?

Has anyone done any experiments on this and is the data published?
Reply With Quote
  #41  
Old 09-10-2013, 09:35 PM
datoneer datoneer is offline
 
Join Date: Jul 2011
Posts: 453
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is my htaccess file, where do i need to put the code?
Quote:
#RewriteOptions inherit
# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/

#RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.imspot\.org$
RewriteRule (.*) http://www.imspot.org/$1 [R=301,L]
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap|api\.php)
RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]

RewriteCond %{QUERY_STRING} ^[0-9]+-([^&]+)
RewriteRule ^/?showthread\.php$ http://www.imspot.org/forums/topic/%1 [L,R=301]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]
Reply With Quote
Reply

Thread Tools

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 10:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09857 seconds
  • Memory Usage 2,352KB
  • Queries Executed 28 (?)
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
  • (2)bbcode_html
  • (1)bbcode_php
  • (7)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (8)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete