vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   Step by Step guide to speed up your VB4 OR VB3 (https://vborg.vbsupport.ru/showthread.php?t=267588)

final kaoss 07-27-2011 10:00 PM

Step by Step guide to speed up your VB4 OR VB3
 
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

Code:

Mod Rewrite Friendly URLs

From: Settings > Options > Friendly Urls: Select Mod Rewrite Friendly Urls

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!!
https://vborg.vbsupport.ru/showthread.php?t=267588#3

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

Step 2: 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 3: Add CSS Sprites.
Not compatible with VB3

This covers the following PageSpeed Rules:

Combine images using CSS sprites

Code:

Install the addon United-Forum CSS Sprites and follow all of the instructions.  Can be found in the sprite_0.6.3a.zip file.
Optional Step 4: Use a CDN
Below are 3 free CDN's. I can vouch for cloudflare but have yet to try incapsula.

1) Incapsula
2) Cloudflare *Disable the Rocketloader feature to avoid potential issues.
New article on how to setup your forum for HTTPS with cloudflare

(Optional) Step 5: 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 of what rewrite rules look like...

Code:

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.

Code:

# Author: Final Kaoss (aka: Extreme-Gaming)
# Version 3.2
# Special Thanks Goes to W3Total Cache for much of the htaccess rules
RewriteEngine on

# This file is only needed if you have set the Forum Component URL in your admincp and you are
# using the mod_rewrite option for friendly urls.  If this is the case, copy this file
# to your forum component stub directory.

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory. 
#If your site is located at site.com/forum, then go down one line uncomment (remove the #) and replace /vbtest/ with /forum/
# RewriteBase /vbtest/

# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
 Options -MultiViews
#add your friendly url rewrite rules below.

#stop adding your friendly url rewrite rules here.


#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>


# BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
    AddType text/css .css
    AddType application/javascript .js
    AddType application/x-javascript .js
    AddType text/html .html .htm
    AddType text/richtext .rtf .rtx
    AddType image/svg+xml .svg .svgz
    AddType text/plain .txt
    AddType text/xsd .xsd
    AddType text/xsl .xsl
    AddType text/xml .xml
    AddType video/asf .asf .asx .wax .wmv .wmx
    AddType video/avi .avi
    AddType image/bmp .bmp
    AddType application/java .class
    AddType video/divx .divx
    AddType application/msword .doc .docx
    AddType application/x-msdownload .exe
    AddType image/gif .gif
    AddType application/x-gzip .gz .gzip
    AddType image/x-icon .ico
    AddType image/jpeg .jpg .jpeg .jpe
    AddType application/vnd.ms-access .mdb
    AddType audio/midi .mid .midi
    AddType video/quicktime .mov .qt
    AddType audio/mpeg .mp3 .m4a
    AddType video/mp4 .mp4 .m4v
    AddType video/mpeg .mpeg .mpg .mpe
    AddType application/vnd.ms-project .mpp
    AddType application/vnd.oasis.opendocument.database .odb
    AddType application/vnd.oasis.opendocument.chart .odc
    AddType application/vnd.oasis.opendocument.formula .odf
    AddType application/vnd.oasis.opendocument.graphics .odg
    AddType application/vnd.oasis.opendocument.presentation .odp
    AddType application/vnd.oasis.opendocument.spreadsheet .ods
    AddType application/vnd.oasis.opendocument.text .odt
    AddType audio/ogg .ogg
    AddType application/pdf .pdf
    AddType image/png .png
    AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
    AddType audio/x-realaudio .ra .ram
    AddType application/x-shockwave-flash .swf
    AddType application/x-tar .tar
    AddType image/tiff .tif .tiff
    AddType audio/wav .wav
    AddType audio/wma .wma
    AddType application/vnd.ms-write .wri
    AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
    AddType application/zip .zip
</IfModule>
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A31536000
    ExpiresByType application/x-javascript A31536000
    ExpiresByType text/html A3600
    ExpiresByType text/richtext A3600
    ExpiresByType image/svg+xml A3600
    ExpiresByType text/plain A3600
    ExpiresByType text/xsd A3600
    ExpiresByType text/xsl A3600
    ExpiresByType text/xml A3600
    ExpiresByType video/asf A31536000
    ExpiresByType video/avi A31536000
    ExpiresByType image/bmp A31536000
    ExpiresByType application/java A31536000
    ExpiresByType video/divx A31536000
    ExpiresByType application/msword A31536000
    ExpiresByType application/x-msdownload A31536000
    ExpiresByType image/gif A31536000
    ExpiresByType application/x-gzip A31536000
    ExpiresByType image/x-icon A31536000
    ExpiresByType image/jpeg A31536000
    ExpiresByType application/vnd.ms-access A31536000
    ExpiresByType audio/midi A31536000
    ExpiresByType video/quicktime A31536000
    ExpiresByType audio/mpeg A31536000
    ExpiresByType video/mp4 A31536000
    ExpiresByType video/mpeg A31536000
    ExpiresByType application/vnd.ms-project A31536000
    ExpiresByType application/vnd.oasis.opendocument.database A31536000
    ExpiresByType application/vnd.oasis.opendocument.chart A31536000
    ExpiresByType application/vnd.oasis.opendocument.formula A31536000
    ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
    ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
    ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
    ExpiresByType application/vnd.oasis.opendocument.text A31536000
    ExpiresByType audio/ogg A31536000
    ExpiresByType application/pdf A31536000
    ExpiresByType image/png A31536000
    ExpiresByType application/vnd.ms-powerpoint A31536000
    ExpiresByType audio/x-realaudio A31536000
    ExpiresByType application/x-shockwave-flash A31536000
    ExpiresByType application/x-tar A31536000
    ExpiresByType image/tiff A31536000
    ExpiresByType audio/wav A31536000
    ExpiresByType audio/wma A31536000
    ExpiresByType application/vnd.ms-write A31536000
    ExpiresByType application/vnd.ms-excel A31536000
    ExpiresByType application/zip A31536000
</IfModule>


# BEGIN Compress text files
<ifModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  AddOutputFilterByType DEFLATE font/truetype font/opentype


  BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifModule>
# END Compress text files
 
 
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
Header set Connection keep-alive
  <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(css)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(js)$">
    Header set Cache-Control "private"
  </filesMatch>
  <filesMatch "\.(x?html?|php)$">
    Header set Cache-Control "private, must-revalidate"
  </filesMatch>
</ifModule>
# END Cache-Control Headers
 
# BEGIN Turn ETags Off
FileETag None
# END Turn ETags Off




# proc/self/environ? no way!
RewriteCond %{QUERY_STRING} proc/self/environ [OR]
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2})

##
##&nbsp; Commented version of Rewrite rules attributed to Ronald van den Heetkamp
##&nbsp; Comments by http://bodvoc.com
#
# Prevent use of specified methods in HTTP Request
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC,OR]
# Block out use of illegal or unsafe characters in the HTTP Request
RewriteCond %{THE_REQUEST} ^.*(\\r|\\n|%0A|%0D).* [NC,OR]
# Block out use of illegal or unsafe characters in the Referer Variable of the HTTP Request
RewriteCond %{HTTP_REFERER} ^(.*)(<|>|'|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
# Block out use of illegal or unsafe characters in any cookie associated with the HTTP Request
RewriteCond %{HTTP_COOKIE} ^.*(<|>|'|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
# Block out use of illegal characters in URI or use of malformed URI
RewriteCond %{REQUEST_URI} ^/(,|;|:|<|>|">|"<|/|\\\.\.\\).{0,9999}.* [NC,OR]
# NOTE - disable this rule if your site is integrated with Payment Gateways such as PayPal
# Block out  use of empty User Agent Strings
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
# Block out  use of User Agent Strings beginning with java, curl or wget
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR]
# Block out  use of User Agent Strings containing specific robot (crawler) identifiers
RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR]
# Block out  use of User Agent Strings containing references to specific crawler libraries
RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|scan).* [NC,OR]
# Block out  use of illegal or unsafe characters in the User Agent variable
RewriteCond %{HTTP_USER_AGENT} ^.*(<|>|'|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
# Measures to block out  SQL injection attacks
RewriteCond %{QUERY_STRING} ^.*(;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|cast|set|declare|drop|update|md5|benchmark).* [NC,OR]
# Block out  reference to localhost/loopback/127.0.0.1 in the Query String
RewriteCond %{QUERY_STRING} ^.*(localhost|loopback|127\.0\.0\.1).* [NC,OR]
# Block out  use of illegal or unsafe characters in the Query String variable
RewriteCond %{QUERY_STRING} ^.*(<|>|'|%0A|%0D|%27|%3C|%3E|%00).* [NC]
#
## End of commented Rewrite directives
#


HMBeaty 07-28-2011 10:48 PM

Just a quick note, for the .htaccess, starting in 4.1.5
Code:

&page=$2
becomes
Code:

&p=$2

final kaoss 07-28-2011 11:15 PM

Fixing login issues with vbulletin 4.

Quote:

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.vgchat.info

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.
After you apply the htaccess in the first post, proceed to do the following:

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.

Dirt Bike Addict 07-29-2011 01:11 PM

Quote:

Originally Posted by extreme-gaming (Post 2226198)
Remove a css request (results in a 404 anyways from gtmetrix tests)

Code:

Open AdminCP and browse to:

Styles & Templates
Style Manager
Select your current skin
Expand the CSS Templates Link
Open Additional.css
Delete the contents inside and save


Maybe rephrase that to only remove it if you haven't added any custom CSS.

final kaoss 07-29-2011 01:12 PM

True, most people however are unaware of it's presence.

Crotan 07-29-2011 06:33 PM

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:
Code:

FileETag MTime Size
    <IfModule mod_headers.c>
        Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>

and

FileETag MTime Size
    <IfModule mod_headers.c>
        Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>

What is this and where does it display?

Also does this require enabling mod rewrite friendly urls? in the admin control panel

final kaoss 07-29-2011 08:00 PM

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

8thos 07-30-2011 06:27 AM

I set up Cloudflare last week.

I'll do the Supercharged mod today. I already have mod-rewrite friendly urls.

Crotan 07-30-2011 05:49 PM

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

8thos 07-30-2011 05:52 PM

Quote:

Originally Posted by Crotan (Post 2226933)
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.

final kaoss 07-30-2011 06:06 PM

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.

Quote:

Originally Posted by Crotan (Post 2226933)
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


Crotan 07-30-2011 06:17 PM

Quote:

Originally Posted by extreme-gaming (Post 2226937)
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

final kaoss 07-30-2011 06:21 PM

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)$">

Crotan 07-30-2011 06:29 PM

Seem to still have issues, I took out

Code:

AddType application/x-javascript .js

ExpiresByType application/x-javascript A31536000

application/x-javascript

This is now only.
Code:

<FilesMatch "\.(css|CSS)$">
  <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"

from the original

Code:

<FilesMatch "\.(css|js|CSS|JS)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"

But still this htaccess interferes with the login of users on IE and Firefox :/

final kaoss 07-30-2011 06:30 PM

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.

Crotan 07-30-2011 06:41 PM

Quote:

Originally Posted by extreme-gaming (Post 2226951)
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.

Clearing the cache on IE9 (CTRL-R) and on Firefox 4 had no affect.

So something else is interfering?

final kaoss 07-30-2011 06:42 PM

Hi, I managed to login as avalanch on firefox 6 over there and didn't experience those issues.

Just tested with IE9, no problems.

Tested with my vb 4.1.3 boards with no htaccess rules removed. Managed to login fine with IE9 & Firefox. (use firefox all the time anyways lol)

Crotan 07-30-2011 06:51 PM

Quote:

Originally Posted by extreme-gaming (Post 2226955)
Hi, I managed to login as avalanch on firefox 6 over there and didn't experience those issues.

firefox 5? 4?

Hmmm when you login does the login at the top of the page say Welcome Avalanch, and give you the notification, My profile, settings, Logout?

or stay on the Login, username and password box?

After I login with firefox, I get redirected to the page and won't be logged in but If I refresh I will be.

It's a little wonky.

For instance, If I logout on the forums, but then go to the CMS tab, it will display as If I were still logged in

final kaoss 07-30-2011 06:56 PM

Hi, go to http://tinychat.com/avalanch07 and I'll setup a cam so you can check out whats going on with the login on my side using firefox 6 & ie9


------------------------------------

It's been verified on my end (via tinychat) that this is not an issue with any tips that I provided.

Crotan 07-30-2011 07:54 PM

I had to remove the caching of several elements to get mine to work without causing a wonky logout and login for IE, and Firefox, I'll have to do more extensive troubleshooting to see exactly what it was, and will report later after I narrow it down.

final kaoss 07-30-2011 07:56 PM

It's pretty interesting that it didn't happen on my end, only on yours.

8thos 07-30-2011 08:46 PM

I've done Step 2 with Cloudflare CDN instead of using supercharged. Supercharged just causes problems.

Do not activate Rocket Load on Cloudflare though.

Step 4 United Forum Sprites actually slowed my site down.

I'll try Step 3 later.


--------------- Added [DATE]1312062709[/DATE] at [TIME]1312062709[/TIME] ---------------

Step 3, you have to create a new domain and cname entry right? That's what page speed and webpagetest.org is telling me. It's telling me to put my whole images folder there.

final kaoss 07-30-2011 10:43 PM

Step 3 deals with reducing the total KB of images & what kind of problems did supercharged cause?

eva2000 07-31-2011 08:20 AM

Thought I'd chime in with a note/tip - just be careful when implementing all this solely via .htaccess. If you have VPS or dedicated server you may already have some of the optimisations configured and setup directly via httpd.conf or httpd.conf include files (i.e. in whm/cpanel) which is the more optimal way of implementing these optimisations.

More online tools and tests for you to check your progress posted on my personal blog at http://vbtechsupport.com/388/

HTH

George

Buray Savas ANI 07-31-2011 03:17 PM

Hi, how to use with vbseo?

final kaoss 07-31-2011 04:36 PM

I don't have vbseo so I can't inform you much about that.

You will want to use vbseo's friendly url rewriting code in the htaccess instead of the one posted here though. So in your case, copy the contents of the htaccess file into the htaccess that vbseo creates. Remove the following code from it and save. I don't believe vb supercharged plays well with vbseo but I'm not sure.

Code:

#Author: Extreme Gaming
#Friendly Urls By: Matty Asia
# Version 1.8
# Usable from vbulletin 4.0.0 - 4.1.4
# Special Thanks Goes to W3Total Cache for much of the htaccess rules
# Downloaded from: https://vborg.vbsupport.ru/showthread.php?t=267588
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "Mozilla/4\.76 \[en\] \(Windows NT 5\.0; U\)"
RewriteRule .* - [F,L]
Options +FollowSymLinks
### THIS IS A LITTLE EXTRA SECURITY AND CAN BE REMOVED
#RewriteRule ^includes/(.*) index.php
#RewriteRule ^vb/(.*) index.php
#RewriteRule ^packages/(.*) index.php
### THIS IS THE ACTUAL REWRITE
RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^$ $1.php?r=$2 [QSA]
## Rewrites
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} -s [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]
RewriteRule ^blogs/.* blog.php [QSA]
ReWriteRule ^entries/.* entry.php [QSA]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]


8thos 07-31-2011 04:45 PM

How do you prevent static images from using cookies? I keep failing this in webpagetest.org.

Proper cookie usage: 40/100

final kaoss 07-31-2011 04:59 PM

I believe for that step domain sharding removes the cookies. I'll have to post back after I look it up a bit more.


YSlow recommends:

To work around this problem, make sure that static components are requested with cookie-free requests by creating a subdomain and hosting them there.

If your domain is www.example.org, you can host your static components on static.example.org. However, if you've already set cookies on the top-level domain example.org as opposed to www.example.org, then all the requests to static.example.org will include those cookies.

In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free.

Yahoo! uses yimg.com, YouTube uses ytimg.com, Amazon uses images-amazon.com and so on.
http://developer.yahoo.com/performan...ml#cookie_free

8thos 07-31-2011 08:10 PM

Quote:

Originally Posted by extreme-gaming (Post 2227301)
I believe for that step domain sharding removes the cookies. I'll have to post back after I look it up a bit more.


YSlow recommends:

To work around this problem, make sure that static components are requested with cookie-free requests by creating a subdomain and hosting them there.

If your domain is www.example.org, you can host your static components on static.example.org. However, if you've already set cookies on the top-level domain example.org as opposed to www.example.org, then all the requests to static.example.org will include those cookies.

In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free.

Yahoo! uses yimg.com, YouTube uses ytimg.com, Amazon uses images-amazon.com and so on.
http://developer.yahoo.com/performan...ml#cookie_free

Would this work?

Admin CP/Cookies and HTTP Header Options

Path to save cookies / (leave blank)
Cookie Domain (use custom setting) www.the8thlegion.com

Then create CNAME entry A

subdomain: images.the8thlegion.com

Move images folder to images.the8thlegion.com or have the folder redirected to it?

final kaoss 07-31-2011 10:13 PM

I believe from what I've been reading is that if your forum is in the root, then it sharding won't work (because the cookies affect any subfolders within, just like a htaccess does to folders if it's set at the root). Cookies will still be delivered. If you make a folder for your forum and move it there to like /forum, then the subdomain sharding would work to prevent cookies.

8thos 08-01-2011 01:18 AM

Quote:

Originally Posted by extreme-gaming (Post 2227404)
I believe from what I've been reading is that if your forum is in the root, then it sharding won't work (because the cookies affect any subfolders within, just like a htaccess does to folders if it's set at the root). Cookies will still be delivered. If you make a folder for your forum and move it there to like /forum, then the subdomain sharding would work to prevent cookies.

Ooohhhhh.

Crapppp.

That would break a whole lotta links right? Cause my ranking to go down?

Damn.

final kaoss 08-01-2011 01:22 AM

It would. You can setup a 301 redirect for google and your visitors though. Within 3-4 month's you should be getting less & less crawl errors/redirects. Personally, I would mass message your members about the change or announce it, then go for it. Or register a new domain.

8thos 08-01-2011 01:31 AM

Damn.

--------------- Added [DATE]1312165937[/DATE] at [TIME]1312165937[/TIME] ---------------

By the way I used that link you posted to optimize images and it made my first byte time faster. Thanks a lot man.

final kaoss 08-01-2011 01:34 AM

No problem, it wasn't too hard to follow the way I explained it was it?

EDIT: Seems you could still use a few more optimized images
Optimizing the following images could reduce their size by 35.6KiB (57% reduction).


Quote:

Originally Posted by Octavius. (Post 2227478)
Damn.

--------------- Added [DATE]1312165937[/DATE] at [TIME]1312165937[/TIME] ---------------

By the way I used that link you posted to optimize images and it made my first byte time faster. Thanks a lot man.


8thos 08-01-2011 03:19 AM

I optimized those images and after uploading them they did not work. They appeared as question marks. The main ones that site was worried about were my menu images. I optimized those. I think I can optimize photopost thumbnails. I had jaxel's media library in the side widget but I need to optimize the thumbnails to be smaller first. I can do that in the settings.

final kaoss 08-01-2011 04:10 AM

You must have dome something wrong. Appearing as question marks means it didn't find the image. Aka a 404 error.

Mooff 08-01-2011 09:27 AM

Quote:

Originally Posted by Octavius. (Post 2227478)
Damn.

--------------- Added [DATE]1312165937[/DATE] at [TIME]1312165937[/TIME] ---------------

By the way I used that link you posted to optimize images and it made my first byte time faster. Thanks a lot man.

What?

Sorry to say that, but how is optimizing images related to first byte time?

Quote:

Originally Posted by wiki
Time To First Byte or TTFB is a measurement that is often used as an indication of the responsiveness of a webserver or other network resources.

It is the duration from the virtual user making an HTTP request to the first byte of the page being received by the browser. This time is made up of the socket connection time, the time taken to send the HTTP request and the time to taken to get the first byte of the page.

In rough the time adds up like this:
Sending http-request (timing should be similar to a ping) - your webserver (apache?) connecting to your php-system, your php system then will check whether the site can be served via your php cache or whether it has to compute everything new. For vbulletin: running the forum.php including all those database queries, takeing the output, go through the template - build the html page. And finally it goes to the user. At this point your webserver finally does know what images/html it has to send. Up until this point he does nothing and waits. So optimizing images does not influence the first byte at all. I would go for statistical fluctuation here.


You can speed up that process by using a web accelerator (varnish for example). With this it would go like that: http-request goes in, web accelerator sends cached page back. We would avoid all database queries and php compilation etc.
Since we can't really serve our users some cache data which does not check for their permissions, web accelerators can only used (not 100% true) for guests and crawlers.

But well guests and crawlers make up most of the traffic anyway, so varnish is a huge gain, really huge gain in speed and server load.

(web accelerator setup is pretty advanced and probably can't be explained in a simple how to - you need a tech admin who knows exactly what he is doing)

8thos 08-01-2011 03:27 PM

Quote:

Originally Posted by Mooff (Post 2227568)
What?

Sorry to say that, but how is optimizing images related to first byte time?



In rough the time adds up like this:
Sending http-request (timing should be similar to a ping) - your webserver (apache?) connecting to your php-system, your php system then will check whether the site can be served via your php cache or whether it has to compute everything new. For vbulletin: running the forum.php including all those database queries, takeing the output, go through the template - build the html page. And finally it goes to the user. At this point your webserver finally does know what images/html it has to send. Up until this point he does nothing and waits. So optimizing images does not influence the first byte at all. I would go for statistical fluctuation here.


You can speed up that process by using a web accelerator (varnish for example). With this it would go like that: http-request goes in, web accelerator sends cached page back. We would avoid all database queries and php compilation etc.
Since we can't really serve our users some cache data which does not check for their permissions, web accelerators can only used (not 100% true) for guests and crawlers.

But well guests and crawlers make up most of the traffic anyway, so varnish is a huge gain, really huge gain in speed and server load.

(web accelerator setup is pretty advanced and probably can't be explained in a simple how to - you need a tech admin who knows exactly what he is doing)

I installed and ran vboptimize, some parts of vbsupercharged, disabled plugins, optimized some images, got rid of apture, activated cloudflare, used some of their compression settings (except for rocketload and minimize javascript and html because they messed up parts of my site) and even ran united forum sprites and my first byte time remains an F. Forwarding this to my host so they can take a look. Thanks.

final kaoss 08-01-2011 05:14 PM

You can always try this plugin as well, to reduce cookies from javascripts, css & images. (just point the resources to a subdomain)

http://wiki.netdna.com/Implementation/vBulletin

https://vborg.vbsupport.ru/external/2011/08/121.png

8thos 08-01-2011 06:07 PM

You mean buy vbSEO?

...............................


All times are GMT. The time now is 06:58 PM.

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.01746 seconds
  • Memory Usage 1,950KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_code_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete