PDA

View Full Version : Step by Step guide to speed up your VB4 OR VB3


final kaoss
28 Jul 2011, 22:53
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

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!!
http://www.vbulletin.org/forum/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 (http://www.microsoft.com/visualstudio/en-us/try) which should be compatible with the addon), you can complete this step in just a few clicks using this addon
http://visualstudiogallery.msdn.microsoft.com/a56eddd3-d79b-48ac-8c8f-2db06ade77c3?SRC=VSIDE

You can also use pnggauntlet (http://pnggauntlet.com/) 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 (http://imageoptim.com/) & Trimage (http://trimage.org/)

If you have alot of jpeg images, you can compress 10 per day with this jpegmini (http://www.jpegmini.com/). 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

Install the addon United-Forum CSS Sprites (http://www.vbulletin.org/forum/showthread.php?t=266696) 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 (http://www.incapsula.com/)
2) Cloudflare (https://www.cloudflare.com/) *Disable the Rocketloader feature to avoid potential issues.
New article on how to setup your forum for HTTPS with cloudflare (https://www.vbulletin.org/forum/showthread.php?t=326118)

(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/general/server-configuration

Here's one additional trick to help improve your seo btw:
[SEO Enhancement] Replace "reload this page" to the thread title (http://www.vbulletin.org/forum/showthread.php?t=242579) [v1.00]

Enjoy!

Optional (Recommended) Step 7: Lazy load images. (http://www.vbulletin.org/forum/showthread.php?t=259302)

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 (http://gtmetrix.com/)
Webpage Test (http://www.webpagetest.org/)
Pingdom (http://tools.pingdom.com/fpt/)

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

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.


# 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
29 Jul 2011, 00:48
Just a quick note, for the .htaccess, starting in 4.1.5
&page=$2
becomes
&p=$2

final kaoss
29 Jul 2011, 01:15
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.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/166322-Ocarina-of-Time-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
29 Jul 2011, 15:11
Remove a css request (results in a 404 anyways from gtmetrix tests)

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
29 Jul 2011, 15:12
True, most people however are unaware of it's presence.

Crotan
29 Jul 2011, 20:33
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:
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
29 Jul 2011, 22:00
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
30 Jul 2011, 08:27
I set up Cloudflare last week.

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

Crotan
30 Jul 2011, 19:49
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
30 Jul 2011, 19:52
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 unaffectedYeah it's doing some weird stuff on my forum. I had to disable twitter style login.

final kaoss
30 Jul 2011, 20:06
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.

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
30 Jul 2011, 20:17
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
30 Jul 2011, 20:21
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
30 Jul 2011, 20:29
Seem to still have issues, I took out

AddType application/x-javascript .js

ExpiresByType application/x-javascript A31536000

application/x-javascript

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

from the original

<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
30 Jul 2011, 20:30
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
30 Jul 2011, 20:41
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
30 Jul 2011, 20:42
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
30 Jul 2011, 20:51
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
30 Jul 2011, 20:56
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
30 Jul 2011, 21:54
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
30 Jul 2011, 21:56
It's pretty interesting that it didn't happen on my end, only on yours.

8thos
30 Jul 2011, 22:46
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 1312062709 at 1312062709 ---------------

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
31 Jul 2011, 00:43
Step 3 deals with reducing the total KB of images & what kind of problems did supercharged cause?

eva2000
31 Jul 2011, 10:20
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
31 Jul 2011, 17:17
Hi, how to use with vbseo?

final kaoss
31 Jul 2011, 18:36
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.

#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: http://www.vbulletin.org/forum/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
31 Jul 2011, 18:45
How do you prevent static images from using cookies? I keep failing this in webpagetest.org.

Proper cookie usage: 40/100

final kaoss
31 Jul 2011, 18:59
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/performance/rules.html#cookie_free

8thos
31 Jul 2011, 22:10
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/performance/rules.html#cookie_freeWould 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
01 Aug 2011, 00:13
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
01 Aug 2011, 03:18
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
01 Aug 2011, 03:22
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
01 Aug 2011, 03:31
Damn.

--------------- Added 1312165937 at 1312165937 ---------------

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
01 Aug 2011, 03:34
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).


Damn.

--------------- Added 1312165937 at 1312165937 ---------------

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
01 Aug 2011, 05:19
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
01 Aug 2011, 06:10
You must have dome something wrong. Appearing as question marks means it didn't find the image. Aka a 404 error.

Mooff
01 Aug 2011, 11:27
Damn.

--------------- Added 1312165937 at 1312165937 ---------------

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?


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
01 Aug 2011, 17:27
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
01 Aug 2011, 19:14
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://www.vbulletin.org/forum/external/2011/08/121.png

8thos
01 Aug 2011, 20:07
You mean buy vbSEO?


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

final kaoss
01 Aug 2011, 20:07
No, that plugin is free.

8thos
01 Aug 2011, 20:29
Where is the download for it? I didn't see it on that site. So I can use cloudflare cdn through this plugin?

BTW I found out what was slowing down my first byte time. It was vbenterprise translator. Either it's not configured right or it's just too much for my site. Disabled for now. Pretty dissapointed right now as it costs $200 something. Asked the mod creator if he does refunds just now.

final kaoss
01 Aug 2011, 20:34
http://discovertheartist.com/product-cdn.xml

(right click and save) & upload

8thos
01 Aug 2011, 21:29
Thanks! Trying to figure this out now.

--------------- Added 1312232398 at 1312232398 ---------------

This is all I have left to fix for speed.

Combine static CSS and JS files: 0/100
Proper cookie usage: 32/100

That vbseo cdn link should fix the proper cookie usage right?

final kaoss
01 Aug 2011, 22:20
it should as long as you point it to either:

A cookieless subdomain
A cookieless domain

You can always get a free hosting account at x10hosting and put your static there & point to it.

steeler7
03 Aug 2011, 18:15
Where is my .htaccess file? I can find the one in my entire website root but under /forum I don't see one. Should I be using the one on my web root or do I have to create an .htaccess file?

final kaoss
03 Aug 2011, 21:53
Ok, if you want to use the one in the /public_html you can. Just add everything in the htaccess provided EXCEPT the rewrite rules. (this will provide caching for any directories contained in the /public_html folder)

Now, after that, your going to have to make a htaccess in your forum root if one isn't already there. Add the friendly url rewrites into that one and your good to go.

steeler7
04 Aug 2011, 03:24
Ok, if you want to use the one in the /public_html you can. Just add everything in the htaccess provided EXCEPT the rewrite rules. (this will provide caching for any directories contained in the /public_html folder)

Now, after that, your going to have to make a htaccess in your forum root if one isn't already there. Add the friendly url rewrites into that one and your good to go.

thanks!

I bypassed doing one in my public_html since it didn't sound like it was needed and I just created an htaccess file using code that you provided

final kaoss
04 Aug 2011, 20:27
ah ok then.

teach1st
08 Aug 2011, 01:10
The .htaccess bit sped up my forums, but made notifications for PMs unreliable. PMs would show in the inbox and then disappear on reload. 4.1.5pl1

rajubd
08 Aug 2011, 01:49
user keep complaining they unable to find new post so I removed it

final kaoss
08 Aug 2011, 05:13
Teach & raj, can you give me some examples?

Also, is this with htaccess alone... with vbsc alone... with htaccess & vb supercharged both used? I need some more details to help you both out.

rajubd
08 Aug 2011, 06:52
I am not using vbseo. problem relate to forum home page only. you can find here user name test pass : 123456 www.mobilephonetalk.com/showthread.php?96732-Hacking-Attempt

teach1st
08 Aug 2011, 11:54
Teach & raj, can you give me some examples?

Also, is this with htaccess alone... with vbsc alone... with htaccess & vbsc both used? I need some more details to help you both out.

I'm not using vb supercharged or any type of SEO that I know of. As far as the delayed PM notifications, I am using Cel Social Groups notifications (http://www.vbulletin.org/forum/misc.php?do=producthelp&pid=cel_sgn_40). Let me know what else you need.

final kaoss
08 Aug 2011, 16:39
vbsc = vb supercharged... not vbseo

rajubd
09 Aug 2011, 17:40
I am not using vb supercharge using vb optimize lite

final kaoss
10 Aug 2011, 01:39
You're going to have to contact vb optimize then. Thanks.

whitey10tc
17 Aug 2011, 03:21
I've given this a try with the end result of
a constant cycling admin cp <-- cloudflare issue,
Login/logout issues <-- All browsers
Ads and images not appearing <-- All browsers.

Although the site was lightning fast, any suggestion mainly for the login issue and images issue, I've disabled cloudflare and the Admincp is back to normal.

final kaoss
17 Aug 2011, 06:01
I would think those issues are related to cloudflare, I set my cloudflare account up via the hostgator wizard and all that I notice is that it saves queries, doesn't serve static from their domains, combine js etc.

whitey10tc
17 Aug 2011, 17:09
I would think those issues are related to cloudflare, I set my cloudflare account up via the hostgator wizard and all that I notice is that it saves queries, doesn't serve static from their domains, combine js etc.The issue with the admin cp I confirmed to be a cloudflare issue, because it stopped after disabling cloudflare but the others continue after modifying the htaccess file.

final kaoss
17 Aug 2011, 18:39
and I'm guessing your using vbsc or vb optimize?

whitey10tc
17 Aug 2011, 21:25
and I'm guessing your using vbsc or vb optimize?

Yes VBSC. on 4.1.3 pl3.

final kaoss
18 Aug 2011, 01:22
I have a feeling that vbsc might be conflicting with some of your mods, the author hasnt updated it since vb 4.0.3 and has told me that there are no plans to continue updating the mod. It has a known history of conflicting with other mods but for now it's the only plugin that I can find that combines js & css for vb4

whitey10tc
18 Aug 2011, 06:36
I have a feeling that vbsc might be conflicting with some of your mods, the author hasnt updated it since vb 4.0.3 and has told me that there are no plans to continue updating the mod. It has a known history of conflicting with other mods but for now it's the only plugin that I can find that combines js & css for vb4:eek: Maybe I'll mirror the forum to a password protected forum disable all the mods, load the htaccess and start loading the mods one by one and see if I can trouble shoot this. The htaccess file and vbsc alone increased the load times to less than 2 seconds, but had the login troubles and refreshing page issues.

final kaoss
18 Aug 2011, 18:07
I'm not sure what's going on but it seems like the same thing with this guy
http://www.vbulletin.org/forum/showpost.php?p=2226959&postcount=18

I had no problems on his site & even showed him, yet on his end, he had problems.

apaydin2148
31 Aug 2011, 17:40
What if I use vbseo? How can I edit htaccess (post3) for vbseo?

final kaoss
02 Sep 2011, 03:13
You can use this with vbseo, here's how.

http://www.vbulletin.org/forum/showpost.php?p=2227290&postcount=26

whitey10tc
03 Sep 2011, 18:28
I'm not sure what's going on but it seems like the same thing with this guy
http://www.vbulletin.org/forum/showpost.php?p=2226959&postcount=18

I had no problems on his site & even showed him, yet on his end, he had problems.I haven't yet figured it out, but I am going to be setting up a new forum to complement the current one so I will further some tests on it before I open it to the public.

gec100
07 Sep 2011, 08:47
how could i use this with CMS?

tried to put it in the root rewriting the original httaccess, but got problems with caching similar to tech and raj problems.

thx

final kaoss
07 Sep 2011, 22:05
Hi, I don't have access to cms. Can you pm me the default htaccess that comes with the cms package?

gec100
08 Sep 2011, 08:47
there is no default httaccess with cms.

here's the one that my isp put there:



deleted ...


i have very little knowledge about httaccess file so i do hope i did not post something i should not :p

final kaoss
09 Sep 2011, 20:57
No sorry that htaccess that your isp left you won't help me look into the cms problems, thanks anyways.

doctorsexy
13 Sep 2011, 16:05
Im having problems with the htaccess i get a 500 error internal server when i use it ...

final kaoss
13 Sep 2011, 21:07
Yeah, your using a CMS as well from what I can see. I don't support the cms, forum only like the title says, sorry. Also gec, I wouldn't be surprised if your issues were cookie related. You might want to check your browser & vbulletin config.

appsfinder
28 Sep 2011, 06:25
hi all i would like this to work for vb3 please can you help what do i need to do for my htccess file?

final kaoss
28 Sep 2011, 23:41
You can use this with vb3 by doing the same thing I linked to in an earlier post.

#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
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>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|js|CSS|JS)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|X SL|XML)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

Lazorbeam
03 Nov 2011, 16:59
I used the htaccess file and was having some issues. New posts, articles and whatnot were not showing up on the forums unless the user refreshed the page.

I had to remove gzip and html caching for these pages to show again.

Dirt Bike Addict
03 Nov 2011, 17:09
I used the htaccess file and was having some issues. New posts, articles and whatnot were not showing up on the forums unless the user refreshed the page.

I had to remove gzip and html caching for these pages to show again.
Never cache your HTML.

Gzip shouldn't cause these problems, try enabling it again without caching your HTML.

Lazorbeam
03 Nov 2011, 17:25
Never cache your HTML.

Gzip shouldn't cause these problems, try enabling it again without caching your HTML.

The htaccess files provided in this thread cache html.

I removed only the html caching part, and the problem was solved. Thanks!

Edit:

Remove
AddType text/html .html .htm
ExpiresByType text/html A3600

Right?

Dirt Bike Addict
03 Nov 2011, 17:35
The htaccess files provided in this thread cache html.

I removed only the html caching part, and the problem was solved. Thanks!

Edit:

Remove
AddType text/html .html .htm
ExpiresByType text/html A3600

Right?
Here's what I use, does pretty much the same thing with a lot less lines.

*May not work on all server setups*


#Caches static files for 30 days
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4|css|js|xml)$">
Header set Cache-Control "max-age=2592000, public, must-revalidate"
</FilesMatch>

#Enables compression
#SetOutputFilter DEFLATE
AddOutputFilter DEFLATE xhtml html htm php css js xml xsl txt javascript x-javascript ico

TECK
03 Nov 2011, 23:21
http://discovertheartist.com/product-cdn.xml

(right click and save) & upload

That product is not available for download anymore. I contact MaxCDN and they don't have the file. Can you please attach it here? Thanks.

final kaoss
04 Nov 2011, 12:58
First you'll have to ask vbseo, since they made the plugin. My bet would be that vbseo contacted discovertheartist.com and asked them to remove the xml from public visitors.

If they wish for it to be public, it is up to them to upload it here, seeing as it isn't my product.

abumohamed
06 Nov 2011, 02:23
great article.
thank you so much

final kaoss
22 Dec 2011, 05:59
This now works for the current vbulletins (4.1.5 and up)

Jump to post 1 for the htaccess

thompson
31 Dec 2011, 13:12
will give it a try.

final kaoss
09 Jan 2012, 23:19
Updated the first post. Now the htaccess has been revised to work with practically any vbulletin setup with or without vbseo installed.

Hornstar
31 Jan 2012, 09:51
Hey I am on vb 3.8.x with vbseo.

Which set of rules should I add to my htaccess file? The one in the first post? or is the one in the 2nd post better? It just looks strange in the fist post because lots of it says vbulletin 4.

Thanks.

final kaoss
02 Feb 2012, 02:01
they are both the same thing. Essentially when using vbseo, the htaccess would look like this.

# 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]

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]

#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType application/x-javascript .js
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
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/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl 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>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|js|CSS|JS)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

weave
14 Feb 2012, 06:43
**Post removed**

w8baby
23 Feb 2012, 16:59
the chatbox seems to stop refreshing/showing content after the .htaccess update from the first post edit

final kaoss
23 Feb 2012, 21:15
Which chat box are you using?

w8baby
24 Feb 2012, 12:05
Which chat box are you using?

the most common one
vsa-chatbox +chatbox addon

the chatbox become stuck at updating... without showing any message after .htaccess update

final kaoss
06 Apr 2012, 15:02
Message me a link and I'll check it out. Anyways I have provided a fix to the login issue when using these htaccess rules. Changes may not show immediately but they will show they are working after some time. Check the first & 3rd post.

Brandon Sheley
06 Apr 2012, 16:11
Nice article but I wouldn't suggest doing everything you mentioned, in particular adding cloudflare (http://admin-talk.com/threads/6454/)..
Research what works for you and what doesn't, I've seen reports of users not being able to access a site after CF was enabled.

final kaoss
06 Apr 2012, 16:29
Give me some posts about CF conflicting with vbulletin. I'd like to look into that.
Nice article but I wouldn't suggest doing everything you mentioned, in particular adding cloudflare (http://admin-talk.com/threads/6454/)..
Research what works for you and what doesn't, I've seen reports of users not being able to access a site after CF was enabled.

Brandon Sheley
08 Apr 2012, 14:42
Give me some posts about CF conflicting with vbulletin. I'd like to look into that.

I (and you) linked directly to my source in the reply already ;) :up:

doileloi
24 May 2012, 04:11
I use 4.1.5 did what you told on page but right now all my forum log in problem /

here my code in

# Author: Final Koass (aka: Extreme-Gaming)
# Version 2.6
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.
# RewriteBase /vbtest/

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

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]


#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
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 A2628000
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType video/asf A2628000
ExpiresByType video/avi A2628000
ExpiresByType image/bmp A2628000
ExpiresByType application/java A2628000
ExpiresByType video/divx A2628000
ExpiresByType application/msword A2628000
ExpiresByType application/x-msdownload A2628000
ExpiresByType image/gif A2628000
ExpiresByType application/x-gzip A2628000
ExpiresByType image/x-icon A2628000
ExpiresByType image/jpeg A2628000
ExpiresByType application/vnd.ms-access A2628000
ExpiresByType audio/midi A2628000
ExpiresByType video/quicktime A2628000
ExpiresByType audio/mpeg A2628000
ExpiresByType video/mp4 A2628000
ExpiresByType video/mpeg A2628000
ExpiresByType application/vnd.ms-project A2628000
ExpiresByType application/vnd.oasis.opendocument.database A2628000
ExpiresByType application/vnd.oasis.opendocument.chart A2628000
ExpiresByType application/vnd.oasis.opendocument.formula A2628000
ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
ExpiresByType application/vnd.oasis.opendocument.text A2628000
ExpiresByType audio/ogg A2628000
ExpiresByType application/pdf A2628000
ExpiresByType image/png A2628000
ExpiresByType application/vnd.ms-powerpoint A2628000
ExpiresByType audio/x-realaudio A2628000
ExpiresByType application/x-shockwave-flash A2628000
ExpiresByType application/x-tar A2628000
ExpiresByType image/tiff A2628000
ExpiresByType audio/wav A2628000
ExpiresByType audio/wma A2628000
ExpiresByType application/vnd.ms-write A2628000
ExpiresByType application/vnd.ms-excel A2628000
ExpiresByType application/zip A2628000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|CSS|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

Please help me on this thank you

final kaoss
24 May 2012, 15:21
Hi, since you are using vbseo, you should make the following changes to your htaccess file.

# 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]

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]


# Author: Final Kaoss (aka: Extreme-Gaming)
# Version 2.6


#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
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 A2628000
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType video/asf A2628000
ExpiresByType video/avi A2628000
ExpiresByType image/bmp A2628000
ExpiresByType application/java A2628000
ExpiresByType video/divx A2628000
ExpiresByType application/msword A2628000
ExpiresByType application/x-msdownload A2628000
ExpiresByType image/gif A2628000
ExpiresByType application/x-gzip A2628000
ExpiresByType image/x-icon A2628000
ExpiresByType image/jpeg A2628000
ExpiresByType application/vnd.ms-access A2628000
ExpiresByType audio/midi A2628000
ExpiresByType video/quicktime A2628000
ExpiresByType audio/mpeg A2628000
ExpiresByType video/mp4 A2628000
ExpiresByType video/mpeg A2628000
ExpiresByType application/vnd.ms-project A2628000
ExpiresByType application/vnd.oasis.opendocument.database A2628000
ExpiresByType application/vnd.oasis.opendocument.chart A2628000
ExpiresByType application/vnd.oasis.opendocument.formula A2628000
ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
ExpiresByType application/vnd.oasis.opendocument.text A2628000
ExpiresByType audio/ogg A2628000
ExpiresByType application/pdf A2628000
ExpiresByType image/png A2628000
ExpiresByType application/vnd.ms-powerpoint A2628000
ExpiresByType audio/x-realaudio A2628000
ExpiresByType application/x-shockwave-flash A2628000
ExpiresByType application/x-tar A2628000
ExpiresByType image/tiff A2628000
ExpiresByType audio/wav A2628000
ExpiresByType audio/wma A2628000
ExpiresByType application/vnd.ms-write A2628000
ExpiresByType application/vnd.ms-excel A2628000
ExpiresByType application/zip A2628000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|CSS|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

After that, you should also do the tip provided in post 3 here.

Fixing login issues with vbulletin 4.



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.

final kaoss
26 May 2012, 01:05
Well for those of you using vb supercharged, I've managed to make it load async which means even faster!

Go to your AdminCP --> Plugins & Products --> Plugin Manager

Find Product vB4: SuperCharged

Open JS Optimiser

Replace all of the code in there with this, then save.

if($vbulletin->options['vbsc_js_enable'] == 1){

$c_vbsc = file_exists(DIR."/clientscript/vbsc.js");
$c_vbscsize = $c_vbsc && filesize(DIR."/clientscript/vbsc.js") > 10;
$c_global = $c_vbsc && filemtime(DIR."/clientscript/vbulletin-core.js") < filemtime(DIR."/clientscript/vbsc.js");

if((!$c_vbsc || !$c_vbscsize || !$c_global) && $vbulletin->options['vbsc_js_common'] == 1){

$err = "<strong style='font-size:13px;background-color:#000;padding:5px;color:#ff9000;font-weight:bold;text-align:center;width:100%;display:block;'>";
if(!$c_vbsc){
$err .= "The file ".DIR."/clientscript/vbsc.js is missing. Ensure the file exists (download and extract vbsc.zip again if not) and that you have the file chmodded as per the installation instructions, then run the Compress Javascript under vB4: SuperCharged in your Admin CP. Report any errors you encounter when running Compress Javascript.<br /><br />";
} else if(!$c_vbscsize){
$err .= "The file ".DIR."/clientscript/vbsc.js is empty. Ensure you have the file chmodded as per the installation instructions and run the Compress Javascript under vB4: SuperCharged in your Admin CP. Report any errors you encounter when running Compress Javascript.<br /><br />";
} else if(!$c_global){
$err .= "The ".DIR."/clientscript/vbsc.js cache has a modification time of before ".DIR."/clientscript/vbulletin-core.js. Your cache is almost certainly out of date. Please run Compress Javascript under vB4: SuperCharged in your Admin CP.<br />If you recently updated vBulletin, you should of course run Compress CSS also :) <br />";
}
$err .= "To prevent issues, your forum is currently running without optimised Javascript as a fallback.<br /><br />As a last resort if you cannot get this message to disappear, disable the Javascript Optimiser.</strong>";
$output = $err.$output;

} else {

/*function vbsc_removejs($var){
//return strpos($var, "threadlist") === false;
return true;
}*/

//eval($vbulletin->options['vbsc_js_files']);
//$GLOBALS['js_files'] = array_filter($GLOBALS['js_files'], 'vbsc_removejs');
require_once (DIR . '/includes/vbsc_global.php');
$GLOBALS['js_uncached'] = '';


function in_arrayi( $needle, $haystack ) {
$found = false;
foreach( $haystack as $value ) {
if( strtolower( $value ) == strtolower( $needle ) ) {
$found = true;
}
}
return $found;
}

function vbsc_jsleave($match){
return (/*stripos($match, "FeatureLoader.js.php") !== false ||*/ stripos($match, "google_ad") !== false || stripos($match, "show_ad") !== false || stripos($match, "_google") !== false || stripos($match, "recaptcha") !== false/* || strpos($match, "treeview.css") !== false || strpos($match, "initVbTreeMenus") !== false || strpos($match, "treeview-min.js") !== false || strpos($match, "SHOW_ALL_TREE_ELEMENTS_THRESHOLD") !== false*/);
}

function vbsc_jsinline($matches){

/*if(strpos($matches[0], "google_ad") !== false || strpos($matches[0], "show_ad") !== false){
return $matches[0];
}*/

// workaround for cms sections and pm new window thing
if(stripos($matches[0], "loadVbCss") === false && stripos($matches[0], "getBaseUrl") === false){
if(vbsc_jsleave($matches[0]))
return $matches[0];

// whitelist specific terms, otherwise leave the javascript where it is as it's likely an embedded script such as ads, custom search etc.
if(stripos($matches[0], "YAHOO") === false && stripos($matches[0], "vbulletin") === false && stripos($matches[0], "forum") === false && stripos($matches[0], "vbphrase") === false && stripos($matches[0], "vB_") === false && stripos($matches[0], "inlinemod") === false && stripos($matches[0], "vbseo") === false && stripos($matches[0], "vsa") === false)
return $matches[0];
}


if(strpos($matches[0], "SESSIONURL =") === false){
$GLOBALS['js_uncached'] .= $matches[0];
return '';
} else {
return $matches[0];
}
}
//var_dump($GLOBALS["js_files"]);

function vbsc_jscached($matches){
global $vbulletin;
//var_dump($matches);
//$ret = "";
//var_dump($matches);
if(in_arrayi($matches[2], $GLOBALS["js_files"]) && strpos($matches[1], "<!--") === false && $vbulletin->options['vbsc_js_common'] == 1){
//return "";
} else {
//return $matches[0];
$GLOBALS["js_uncached"] .= $matches[0];

if(strpos($matches[1], "<!--") !== false){
// handle IE conditional comments and normal comments
if(strpos($matches[1], "[if ") === false){
$GLOBALS["js_uncached"] .= " -->";
} else {
$GLOBALS["js_uncached"] .= " <![endif]-->";
}
}

}

if(vbsc_jsleave($matches[0]))
return $matches[0];



//return strpos($matches[1], "if") !== false ? $matches[1] : $ret;
// leave original comment opener in place as closing comment is not covered by the regex
return $matches[1];
}

$output = str_replace(array("<!-- Editor Scripts -->", "<!-- scripts for quick reply and quick edit -->", "<!-- / ajax errors table -->", "<!-- ajax errors table -->", "<!-- lightbox scripts -->
", "<!-- / lightbox scripts -->"), "", $output);

//type="text\/javascript"
// handle potentially cached vBulletin javascript code
$output = preg_replace_callback('/(<!--.*?]>\s+)?<script [^>]*?src=".*?clientscript\/([^?"]+).*?">\s*?<\/script>?/i', 'vbsc_jscached', $output);

// handle YUI treeview code amongst other things
$output = preg_replace_callback('/<script[^>]*?type=[\'"]text\/javascript[\'"] src="http:\/\/yui.yahooapis.com\/.*?">\s*?<\/script>/is', 'vbsc_jsinline', $output);

// handle inline javascript code
$output = preg_replace_callback('/<script[^>]*?type=[\'"]text\/javascript[\'"]>.*?<\/script>/is', 'vbsc_jsinline', $output);

$readyfix = "";
if($vbulletin->options['vbsc_js_common'] != 1){
$readyfix = '<script type="text/javascript">YAHOO.util.Event.onDOMReady(function() {if(YAHOO.vBulletin.vB_XHTML_Ready) return; console.log("Fire vB_XHTML_Ready");vB_XHTML_Ready.fire();YAHOO.vBulletin.vB_XHTML_Ready = true;});</script>';
}

// append vbsc.js
$output = preg_replace('/(<\/body>)/i', ($vbulletin->options['vbsc_js_common'] == 1 ? '<script type="text/javascript" src="clientscript/vbsc.js" async="async"></script>' : '').$GLOBALS["js_uncached"].$readyfix.'$1', $output, 1);




//$output = preg_replace('/<script type="text\/javascript">\s+<!--\s+\/\/ Main vBulletin Javascript Initialization/', '<script type="text/javascript" src="/clientscript/vbsc.js"></script>'.$GLOBALS["js_uncached"].'$1', $output, 1);

//$output = str_replace('SECURITYTOKEN', 'vbsc_SECURITYTOKEN', $output);
}
}

It will now defer the parsing of the vbsc.js file, saving a few hundred KB and increasing your page load time!

apokphp
30 May 2012, 07:56
I'm having trouble getting the mod rewrite to work properly on a clean 4.2 suite install.

http://www.forgeofreason.com/forum/forum.php

It's set to mod rewrite.
vb is installed in the /forum/ directory.
Currently, there is nothing in the root directory, but I'd like to have the CMS at the root.
All the links (forum, what's new, usercp, blogs, etc...) work fine w/ the mod rewrite. However, it is only the Articles (or CMS) that doesn't work, and it returns a 404 page not found error. It's url is http://www.forgeofreason.com/forum/content.php

Did I do something wrong?

I did edit your sample htaccess by uncommenting 2 lines (but am not sure if I should have):

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
RewriteBase /forum/

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

final kaoss
31 May 2012, 16:50
I don't own the vbsuite but it looks like you sorted it out :)

final kaoss
30 Jun 2012, 17:58
Thread updated, pnggauntlet added to the first post to use to crush images and the cloudflare suggestion has been changed a bit too.

mathforum
04 Aug 2012, 23:35
I've installed the .htaccess additions on my site and it helped very slightly according to Google PageSpeed Insight but it still says a lot of images don't have the proper expirations specified at all, and they are all standard file extensions (.jpg, .gif, etc)

Ideas? My site is www.mathhelpboards.com

final kaoss
06 Aug 2012, 15:53
I've looked at your page and it seems that one of the issues is that Enable Keep-Alive isn't being used. Your images are actually being cached properly.

http://gtmetrix.com/reports/www.mathhelpboards.com/NKnBCSMk

This report shows you reports from google pagespeed and yahoo's yslow.

mathforum
12 Aug 2012, 18:40
Thank you! We just moved to a VPS and it appears our keep-alive settings are working better. Here is an updated report. There's still lots things that aren't optimal. CSS sprites would certainly help.

http://gtmetrix.com/reports/www.mathhelpboards.com/fZj9iHK7

darkoutzide
12 Nov 2012, 08:55
Thanks for the tip! my website is faster now :)

moustafa
28 Nov 2012, 17:56
Well for those of you using vb supercharged, I've managed to make it load async which means even faster!

Go to your AdminCP --> Plugins & Products --> Plugin Manager

Find Product vB4: SuperCharged

Open JS Optimiser

Replace all of the code in there with this, then save.

if($vbulletin->options['vbsc_js_enable'] == 1){

$c_vbsc = file_exists(DIR."/clientscript/vbsc.js");
$c_vbscsize = $c_vbsc && filesize(DIR."/clientscript/vbsc.js") > 10;
$c_global = $c_vbsc && filemtime(DIR."/clientscript/vbulletin-core.js") < filemtime(DIR."/clientscript/vbsc.js");

if((!$c_vbsc || !$c_vbscsize || !$c_global) && $vbulletin->options['vbsc_js_common'] == 1){

$err = "<strong style='font-size:13px;background-color:#000;padding:5px;color:#ff9000;font-weight:bold;text-align:center;width:100%;display:block;'>";
if(!$c_vbsc){
$err .= "The file ".DIR."/clientscript/vbsc.js is missing. Ensure the file exists (download and extract vbsc.zip again if not) and that you have the file chmodded as per the installation instructions, then run the Compress Javascript under vB4: SuperCharged in your Admin CP. Report any errors you encounter when running Compress Javascript.<br /><br />";
} else if(!$c_vbscsize){
$err .= "The file ".DIR."/clientscript/vbsc.js is empty. Ensure you have the file chmodded as per the installation instructions and run the Compress Javascript under vB4: SuperCharged in your Admin CP. Report any errors you encounter when running Compress Javascript.<br /><br />";
} else if(!$c_global){
$err .= "The ".DIR."/clientscript/vbsc.js cache has a modification time of before ".DIR."/clientscript/vbulletin-core.js. Your cache is almost certainly out of date. Please run Compress Javascript under vB4: SuperCharged in your Admin CP.<br />If you recently updated vBulletin, you should of course run Compress CSS also :) <br />";
}
$err .= "To prevent issues, your forum is currently running without optimised Javascript as a fallback.<br /><br />As a last resort if you cannot get this message to disappear, disable the Javascript Optimiser.</strong>";
$output = $err.$output;

} else {

/*function vbsc_removejs($var){
//return strpos($var, "threadlist") === false;
return true;
}*/

//eval($vbulletin->options['vbsc_js_files']);
//$GLOBALS['js_files'] = array_filter($GLOBALS['js_files'], 'vbsc_removejs');
require_once (DIR . '/includes/vbsc_global.php');
$GLOBALS['js_uncached'] = '';


function in_arrayi( $needle, $haystack ) {
$found = false;
foreach( $haystack as $value ) {
if( strtolower( $value ) == strtolower( $needle ) ) {
$found = true;
}
}
return $found;
}

function vbsc_jsleave($match){
return (/*stripos($match, "FeatureLoader.js.php") !== false ||*/ stripos($match, "google_ad") !== false || stripos($match, "show_ad") !== false || stripos($match, "_google") !== false || stripos($match, "recaptcha") !== false/* || strpos($match, "treeview.css") !== false || strpos($match, "initVbTreeMenus") !== false || strpos($match, "treeview-min.js") !== false || strpos($match, "SHOW_ALL_TREE_ELEMENTS_THRESHOLD") !== false*/);
}

function vbsc_jsinline($matches){

/*if(strpos($matches[0], "google_ad") !== false || strpos($matches[0], "show_ad") !== false){
return $matches[0];
}*/

// workaround for cms sections and pm new window thing
if(stripos($matches[0], "loadVbCss") === false && stripos($matches[0], "getBaseUrl") === false){
if(vbsc_jsleave($matches[0]))
return $matches[0];

// whitelist specific terms, otherwise leave the javascript where it is as it's likely an embedded script such as ads, custom search etc.
if(stripos($matches[0], "YAHOO") === false && stripos($matches[0], "vbulletin") === false && stripos($matches[0], "forum") === false && stripos($matches[0], "vbphrase") === false && stripos($matches[0], "vB_") === false && stripos($matches[0], "inlinemod") === false && stripos($matches[0], "vbseo") === false && stripos($matches[0], "vsa") === false)
return $matches[0];
}


if(strpos($matches[0], "SESSIONURL =") === false){
$GLOBALS['js_uncached'] .= $matches[0];
return '';
} else {
return $matches[0];
}
}
//var_dump($GLOBALS["js_files"]);

function vbsc_jscached($matches){
global $vbulletin;
//var_dump($matches);
//$ret = "";
//var_dump($matches);
if(in_arrayi($matches[2], $GLOBALS["js_files"]) && strpos($matches[1], "<!--") === false && $vbulletin->options['vbsc_js_common'] == 1){
//return "";
} else {
//return $matches[0];
$GLOBALS["js_uncached"] .= $matches[0];

if(strpos($matches[1], "<!--") !== false){
// handle IE conditional comments and normal comments
if(strpos($matches[1], "[if ") === false){
$GLOBALS["js_uncached"] .= " -->";
} else {
$GLOBALS["js_uncached"] .= " <![endif]-->";
}
}

}

if(vbsc_jsleave($matches[0]))
return $matches[0];



//return strpos($matches[1], "if") !== false ? $matches[1] : $ret;
// leave original comment opener in place as closing comment is not covered by the regex
return $matches[1];
}

$output = str_replace(array("<!-- Editor Scripts -->", "<!-- scripts for quick reply and quick edit -->", "<!-- / ajax errors table -->", "<!-- ajax errors table -->", "<!-- lightbox scripts -->
", "<!-- / lightbox scripts -->"), "", $output);

//type="text\/javascript"
// handle potentially cached vBulletin javascript code
$output = preg_replace_callback('/(<!--.*?]>\s+)?<script [^>]*?src=".*?clientscript\/([^?"]+).*?">\s*?<\/script>?/i', 'vbsc_jscached', $output);

// handle YUI treeview code amongst other things
$output = preg_replace_callback('/<script[^>]*?type=[\'"]text\/javascript[\'"] src="http:\/\/yui.yahooapis.com\/.*?">\s*?<\/script>/is', 'vbsc_jsinline', $output);

// handle inline javascript code
$output = preg_replace_callback('/<script[^>]*?type=[\'"]text\/javascript[\'"]>.*?<\/script>/is', 'vbsc_jsinline', $output);

$readyfix = "";
if($vbulletin->options['vbsc_js_common'] != 1){
$readyfix = '<script type="text/javascript">YAHOO.util.Event.onDOMReady(function() {if(YAHOO.vBulletin.vB_XHTML_Ready) return; console.log("Fire vB_XHTML_Ready");vB_XHTML_Ready.fire();YAHOO.vBulletin.vB_XHTML_Ready = true;});</script>';
}

// append vbsc.js
$output = preg_replace('/(<\/body>)/i', ($vbulletin->options['vbsc_js_common'] == 1 ? '<script type="text/javascript" src="clientscript/vbsc.js" async="async"></script>' : '').$GLOBALS["js_uncached"].$readyfix.'$1', $output, 1);




//$output = preg_replace('/<script type="text\/javascript">\s+<!--\s+\/\/ Main vBulletin Javascript Initialization/', '<script type="text/javascript" src="/clientscript/vbsc.js"></script>'.$GLOBALS["js_uncached"].'$1', $output, 1);

//$output = str_replace('SECURITYTOKEN', 'vbsc_SECURITYTOKEN', $output);
}
}

It will now defer the parsing of the vbsc.js file, saving a few hundred KB and increasing your page load time!


Kindly tell me where to find the JS Optimiser.

Thanks.

final kaoss
29 Nov 2012, 14:34
It's part of the plugin called vB4: SuperCharged, as it says in your quote.

moustafa
03 Dec 2012, 15:18
It's part of the plugin called vB4: SuperCharged, as it says in your quote.

i have the plugin but i don;t see the js optimizer, could you kindly guide me to do it?

final kaoss
03 Dec 2012, 16:03
You can find it here.



And you can edit the source of it by going here.

Go to your AdminCP --> Plugins & Products --> Plugin Manager

Find Product vB4: SuperCharged

Open JS Optimiser

final kaoss
07 Feb 2013, 04:55
*Update, three easy to use and free services that help with static content contribution has been added, some of which act as a CDN aside from just recommending cloudflare as I did previously.

synseal
25 Feb 2013, 13:03
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.

I am also experiencing this issue logging in and so are other members after adding the vbseo version of the .htaccess.

Where is this whitelist in vboptions also where is this setting "vb and photopost"?.

Never seen these options before neither do I have anything called whitelist or photopost in vb options.

Can you elaborate on this please?.

final kaoss
25 Feb 2013, 15:41
I don't use photopost but you can adjust the cookies here:
Admin CP > Options > Cookies and HTTP Header Options
and you can find the whitelist options here:
Admin CP > Options > General Settings

coolbreeze86
12 Mar 2013, 20:13
have a small doubt,

where to add the content i have two .htaccess one in domain root and the other in www.domain.com/forums. mine is vb4.1.5 with vbseo.

--------------- Added 1363121902 at 1363121902 ---------------

hi any serious help will be appreciated,

i had changed the .htaccess but sub forums are not opening just leading to 404 error pages. any help plssss

final kaoss
17 Mar 2013, 16:27
you need to edit the one in the forum root.

Also since your using vbseo, use this htaccess and edit it to reflect your forum path. If your Friendly Rewrite Rules are different then edit it below.

# Author: Final Kaoss
# Version 2.8
# Special Thanks Goes to W3Total Cache for much of the htaccess rules
# Downloaded from: http://www.vbulletin.org/forum/showthread.php?t=288429
RewriteEngine on

#Friendly Rewrite Rules Start

# 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]

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 %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]


#Friendly Rewrite Rules End

#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
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 A2628000
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType video/asf A2628000
ExpiresByType video/avi A2628000
ExpiresByType image/bmp A2628000
ExpiresByType application/java A2628000
ExpiresByType video/divx A2628000
ExpiresByType application/msword A2628000
ExpiresByType application/x-msdownload A2628000
ExpiresByType image/gif A2628000
ExpiresByType application/x-gzip A2628000
ExpiresByType image/x-icon A2628000
ExpiresByType image/jpeg A2628000
ExpiresByType application/vnd.ms-access A2628000
ExpiresByType audio/midi A2628000
ExpiresByType video/quicktime A2628000
ExpiresByType audio/mpeg A2628000
ExpiresByType video/mp4 A2628000
ExpiresByType video/mpeg A2628000
ExpiresByType application/vnd.ms-project A2628000
ExpiresByType application/vnd.oasis.opendocument.database A2628000
ExpiresByType application/vnd.oasis.opendocument.chart A2628000
ExpiresByType application/vnd.oasis.opendocument.formula A2628000
ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
ExpiresByType application/vnd.oasis.opendocument.text A2628000
ExpiresByType audio/ogg A2628000
ExpiresByType application/pdf A2628000
ExpiresByType image/png A2628000
ExpiresByType application/vnd.ms-powerpoint A2628000
ExpiresByType audio/x-realaudio A2628000
ExpiresByType application/x-shockwave-flash A2628000
ExpiresByType application/x-tar A2628000
ExpiresByType image/tiff A2628000
ExpiresByType audio/wav A2628000
ExpiresByType audio/wma A2628000
ExpiresByType application/vnd.ms-write A2628000
ExpiresByType application/vnd.ms-excel A2628000
ExpiresByType application/zip A2628000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|CSS|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB5"
</IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB5"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

mykkal
08 Apr 2013, 14:28
Hey there,

I installed the additions to my htacess. However now I cannot login. I can get in the ACP and login...somehow that was not affected but I cannot login/logout from the frontend.

I'm using 3.8.7. Not sure what to do here. The options for fixing this in the post don't exist. for VB3.8.7.

If you are using vbulletin 4 with vbseo or if your using vb3.8.x, simply add this below your rewrite rules in your existing htaccess file to enable caching.

This covers the following Pagespeed Rules.

Leverage browser caching
Specify a cache validator
Enable gzip compression

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)

final kaoss
08 Apr 2013, 18:13
Did you try the whitelisting tip? It's been forever since I used vb3, the options for it should be available though.

http://www.vbulletin.org/forum/showpost.php?p=2226244&postcount=3

DGrey2011
10 Apr 2013, 21:52
This guide shows in the 1st step how to do these:

Leverage browser caching
Specify a cache validator
Enable gzip compression

I already have set on the server the gzip compression and I have a cache validator specified.

So, I just need to add in the .htaccess the part about the Leverage browser caching. But I don't know exactly which part of the code you gave is reffering to that.
Please help?

bfdzio
11 Apr 2013, 15:49
I'm having trouble getting the mod rewrite to work properly on a clean 4.2 suite install.

http://www.forgeofreason.com/forum/forum.php

It's set to mod rewrite.
vb is installed in the /forum/ directory.
Currently, there is nothing in the root directory, but I'd like to have the CMS at the root.
All the links (forum, what's new, usercp, blogs, etc...) work fine w/ the mod rewrite. However, it is only the Articles (or CMS) that doesn't work, and it returns a 404 page not found error. It's url is http://www.forgeofreason.com/forum/content.php

Did I do something wrong?

I did edit your sample htaccess by uncommenting 2 lines (but am not sure if I should have):

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
RewriteBase /forum/

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

I don't own the vbsuite but it looks like you sorted it out :)

@final kaoss, do you have any solution for this by chance? I know you don't have vbsuite but I can't get my CMS to work and thing this is what is doing it.

It tries to go to content.php but redirects and ends up in forum/content/ which does not exist.

final kaoss
12 Apr 2013, 21:21
Try using this.

# Author: Final Kaoss (aka: Extreme-Gaming)
# Version 2.7
# 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.
# RewriteBase /vbtest/

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

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]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]


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

RewriteRule ^.*$ - [NC,L]

# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]

# Check MVC result
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ - [NC,L]
RewriteRule ^(.*)$ - [R=404,L]



#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
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 A2628000
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType video/asf A2628000
ExpiresByType video/avi A2628000
ExpiresByType image/bmp A2628000
ExpiresByType application/java A2628000
ExpiresByType video/divx A2628000
ExpiresByType application/msword A2628000
ExpiresByType application/x-msdownload A2628000
ExpiresByType image/gif A2628000
ExpiresByType application/x-gzip A2628000
ExpiresByType image/x-icon A2628000
ExpiresByType image/jpeg A2628000
ExpiresByType application/vnd.ms-access A2628000
ExpiresByType audio/midi A2628000
ExpiresByType video/quicktime A2628000
ExpiresByType audio/mpeg A2628000
ExpiresByType video/mp4 A2628000
ExpiresByType video/mpeg A2628000
ExpiresByType application/vnd.ms-project A2628000
ExpiresByType application/vnd.oasis.opendocument.database A2628000
ExpiresByType application/vnd.oasis.opendocument.chart A2628000
ExpiresByType application/vnd.oasis.opendocument.formula A2628000
ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
ExpiresByType application/vnd.oasis.opendocument.text A2628000
ExpiresByType audio/ogg A2628000
ExpiresByType application/pdf A2628000
ExpiresByType image/png A2628000
ExpiresByType application/vnd.ms-powerpoint A2628000
ExpiresByType audio/x-realaudio A2628000
ExpiresByType application/x-shockwave-flash A2628000
ExpiresByType application/x-tar A2628000
ExpiresByType image/tiff A2628000
ExpiresByType audio/wav A2628000
ExpiresByType audio/wma A2628000
ExpiresByType application/vnd.ms-write A2628000
ExpiresByType application/vnd.ms-excel A2628000
ExpiresByType application/zip A2628000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|CSS|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

bfdzio
15 Apr 2013, 15:44
That did the trick, thank you for all of this. Using this I was able to get my Pagespeed score up from 51 to 92.

Also went from F and D ratings on GTMetrix to A+'s


Oh and my board is stupid fast.

--------------- Added 1366070488 at 1366070488 ---------------

Don't know if this is related, but now when I try to post an embed of a tweet, it takes you to "about:blank" but the post is posted still.

--------------- Added 1366078991 at 1366078991 ---------------

Also...ability to mark forums read by clicking the forum icon does not work now?

final kaoss
16 Apr 2013, 16:30
I've just tried the doubleclicking on the forum icon to mark as read and it is still working for me, just don't "double click" as fast as you normally would outside of a browser. Also, I'm not sure about the twittter issue.

Also not only is your board faster but you should see drastic improvements in bandwith, cpu & memory usage.

bfdzio
17 Apr 2013, 20:55
I've just tried the doubleclicking on the forum icon to mark as read and it is still working for me, just don't "double click" as fast as you normally would outside of a browser. Also, I'm not sure about the twittter issue.

Also not only is your board faster but you should see drastic improvements in bandwith, cpu & memory usage.

Yeah I should look into the memory usage on the dedicated...but its overkill as is.


One more question, is there a way to disable these features on just a specific style? I ask because many users and me are experiencing the page numbers on the mobile style not showing up anymore, randomly. Sometimes they are there, sometimes they are not. It has to be a caching issue.

As for double clicking, tried a few things...no go.

final kaoss
17 Apr 2013, 21:23
Link me to your site & I'll have a look at it for you, I myself don't use mobile that much but I'll check it out for you to see what's going on.

bfdzio
17 Apr 2013, 21:38
Link me to your site & I'll have a look at it for you, I myself don't use mobile that much but I'll check it out for you to see what's going on.

sending a PM

bzcomputers
18 Apr 2013, 02:20
Noticed all the javascript was not being gzipped.

Seems "application/x-javascript" is not doing it. Need to add "application/javascript" to the mod_deflate output filters. After adding that all vBulletin javascript is being reporting as compressed.


Edit Line:
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon

To Read:
AddOutputFilterByType DEFLATE text/css application/x-javascript application/javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon


Before Change:

Use gzip compression for transferring compressable responses: 77/100

286.3 KB total in compressible text, target size = 220.5 KB - potential savings = 65.8 KB
FAILED - (51.1 KB, compressed = 15.2 KB - savings of 35.9 KB) - http://www.XXX.com/forum/clientscript/vbulletin-core.js?v=420
FAILED - (14.4 KB, compressed = 3.8 KB - savings of 10.6 KB) - http://www.XXX.com/forum/clientscript/vbulletin_overlay.js?v=420
FAILED - (12.5 KB, compressed = 3.6 KB - savings of 8.9 KB) - http://www.XXX.com/forum/clientscript/vbulletin_lightbox.js?v=420
FAILED - (7.2 KB, compressed = 2.5 KB - savings of 4.7 KB) - http://www.XXX.com/forum/vbseo/resources/scripts/vbseo_ui.js?v=a4
FAILED - (5.7 KB, compressed = 2.3 KB - savings of 3.4 KB) - http://www.XXX.com/forum/clientscript/vbulletin_md5.js?v=420
FAILED - (4.4 KB, compressed = 2.0 KB - savings of2.4 KB) - http://www.XXX.com/forum/clientscript/vbulletin_cms.js?v=420

After Change:

Use gzip compression for transferring compressable responses: 100/100

220.5 KB total in compressible text, target size = 220.5 KB - potential savings = 0.0 KB

That is a savings of almost 70% for javascript transfers on a default cms page.


---------------------
Edit: Any reason you are not also recommending the caching of static javascript?

final kaoss
18 Apr 2013, 04:20
I'll have to look into that a bit more tomorrow.
Right now, I have to use my iPod, due to the storms over here just a bit east of OKC, oklahoma. Most of that htaccess is from the mod w3tc total cache for Wordpress with the vbulletin friendly URL rewrites.

Odd, I've never noticed my scores failing on that part. http://gtmetrix.com/reports/www.video-game-chat.com/Bzmh2VF9
At any rate, it's been added to the htaccess in the first post. Thanks for that!

final kaoss
22 Apr 2013, 20:00
First post updated with an assortment of different htaccess setups that should help people using vbseo, clogic seo for vb3 or yabbseo for vb3.

Delfi_r
07 Jul 2013, 16:47
I have applied Step one and the effect is wonderful, now I'm optimising images, but in the vB4 SuperCharged mod it states that we sould'nt use on vB 4.21. Can I use it? with your recomendations to disable:

Enable Html Optimiser
Enable Javascript Optimiser
Enable Attachment Optimiser

Or I should care anything?

final kaoss
07 Jul 2013, 18:52
The author hasn't updated it in quite some time. I still use it on my vbulletin 4 which is updated to the latest version. You can use them if you find they work for your forum but be aware of the warnings listed for each one.

I don't use the html optimizer because using gzip/mod deflate, the whitespace really doesn't become a big issue... unless you have thousands of linebreaks with no content, even so, I don't find a reason to let it consume extra cpu & memory when compressing with gzip/mod deflate.
Javascript Optimizer, I think I remember there being issues with loading the editor & other mods with it enabled, so I leave it off.
The Attachement Optimizer has a warning against using it on apache servers, since I run apache, I leave it off.

Delfi_r
09 Jul 2013, 00:35
Thanks for your reply. I've put all this way and runs fine (and Pagespped score goes form 50 to 86!) Now I'm in the way to install TMS to get United-Forum CSS Sprites running or install the changes manually

final kaoss
09 Jul 2013, 15:18
Good to hear but remember that on the pagespeed tests, the most you can do for the external stuff is try to defer them & try to reduce the script size. Also try to get in touch with whoever is serving third party scripts to you if anyone and ask them about enabling caching on their side.

leanbulk
11 Aug 2013, 19:46
When I download the attachment containing htaccess examples, and unzip, the folders are empty.

final kaoss
11 Aug 2013, 22:27
Hi, I just redownloaded the same attachment to test your claim, I can see every one of them fine. There is a .htaccess within the folders. Upload the right one to your forum root.

leanbulk
12 Aug 2013, 03:58
Hi, I just redownloaded the same attachment to test your claim, I can see every one of them fine. There is a .htaccess within the folders. Upload the right one to your forum root.

What kind of files are they? I'm on a MAC. I didnt realize we were uploading a new .htaccess. I thought we were just editing our own with your code.

final kaoss
12 Aug 2013, 04:23
Whichever works for you, I have them worked out to where many people shouldn't need to edit the file much from it's current state.

And yeah I don't use Mac but they should show up on your OS.

I saw that you are using vbseo in another article, this one should work for you.

# Author: Final Kaoss (aka: Extreme-Gaming)
# Version 2.7
# 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.
# RewriteBase /vbtest/

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

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

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 %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]

#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
AddType text/css .css
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
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 A2628000
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType video/asf A2628000
ExpiresByType video/avi A2628000
ExpiresByType image/bmp A2628000
ExpiresByType application/java A2628000
ExpiresByType video/divx A2628000
ExpiresByType application/msword A2628000
ExpiresByType application/x-msdownload A2628000
ExpiresByType image/gif A2628000
ExpiresByType application/x-gzip A2628000
ExpiresByType image/x-icon A2628000
ExpiresByType image/jpeg A2628000
ExpiresByType application/vnd.ms-access A2628000
ExpiresByType audio/midi A2628000
ExpiresByType video/quicktime A2628000
ExpiresByType audio/mpeg A2628000
ExpiresByType video/mp4 A2628000
ExpiresByType video/mpeg A2628000
ExpiresByType application/vnd.ms-project A2628000
ExpiresByType application/vnd.oasis.opendocument.database A2628000
ExpiresByType application/vnd.oasis.opendocument.chart A2628000
ExpiresByType application/vnd.oasis.opendocument.formula A2628000
ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
ExpiresByType application/vnd.oasis.opendocument.text A2628000
ExpiresByType audio/ogg A2628000
ExpiresByType application/pdf A2628000
ExpiresByType image/png A2628000
ExpiresByType application/vnd.ms-powerpoint A2628000
ExpiresByType audio/x-realaudio A2628000
ExpiresByType application/x-shockwave-flash A2628000
ExpiresByType application/x-tar A2628000
ExpiresByType image/tiff A2628000
ExpiresByType audio/wav A2628000
ExpiresByType audio/wma A2628000
ExpiresByType application/vnd.ms-write A2628000
ExpiresByType application/vnd.ms-excel A2628000
ExpiresByType application/zip A2628000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\.(css|CSS|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg| jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods |odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xl sx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|I CO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF |ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WR I|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag MTime Size
<IfModule mod_headers.c>
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
</IfModule>
</FilesMatch>
# End Browser Caching/Headers

tommythejoat
20 Aug 2013, 15:24
When I run the load tests I get a failing score in browser caching so I would like to improve that.

This statement at the top of your .htaccess file confuses me. # 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.

We run our forums in the web root, no subdirectory. If I turn on mod-rewrite friendly url's in AdminCP my board goes into an endless load loop. We are currently using basic friendly url's

We have a mod in place from a long ago import process that translates foreign references to our old message board location to the current location with translations of post, thread, etc. id's from the old values before import to the current imported values.

I know I should do a bulk edit and replace all those old url's with the current ones, but it is quite a bit of work.

I am hoping there is some way I can get to better browser caching with a bit less work than a bulk edit of 11 years of threads and posts.

RichieBoy67
20 Aug 2013, 16:43
First off this is a very old article. What version of Vbulletin are you using?

If your site has been up for a long time I would not change the url structure. It will hurt you in Google badly.

If you want to pm me your url I will take a look and give you some suggestions.

final kaoss
20 Aug 2013, 23:57
Yes I agree if you have been using regular urls, then you're probably better off with sticking to those kinds of urls.

Delete the rewrite rules above this part:
#Deny attempts to view the Htaccess file.

BTW... did you copy what I posted in my last post? That is for vbseo users. I have an attachment with a suite of different .htaccess setups, even one that doesn't support the mod-rewrite FURL's.

final kaoss
05 Sep 2013, 01:02
Updated with some new caching & gzipping methods on page one. Feel free to test out the new htaccess.

I'll keep trying it & checking out everyone's response to it for one month and if all goes well I'll replace the original zip file with the updated one which now also protects viewing of the htaccess file itself & several methods of injection.

Krusty1231
05 Sep 2013, 03:10
Thank you for taking the time to create, paste, and PM me. It works flawless. You have a PM.

Thanks again Final Kaoss!

GoneBushX
08 Sep 2013, 01:47
THX M8 :D

Excellent Info-
http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html

final kaoss
08 Sep 2013, 16:40
No problem guys :P

goxy63
13 Sep 2013, 15:44
Minor problem with article editing:
When editing article its saves and content after edit is there, but if after edit I go again in edit area content which I edited previously is not there. After clearing cache from browser and going in editing area everything seems to be ok.

Another thing, do I have to do all steps from this article in order that .htaccess code works properly or I can miss some of those [modificatios] ?

Running VB 4.2.1, using .htaccess code from first post here, and on top of your code I got this:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
in forums and in public_html root .htaccess file

All in all great .htaccess code , my site is like 30-40% faster loading pages :]

edited:

Users reporting problems with writing messages in user profile, message which someone posted in profile is not vissible by owner of profile or something like that, also user is deleting posted images in profile than after reloadin profile page pictures are still there...cache issue looks like as after some time its all ok

ps
few days ago I changed in VB amdinCP from basic friendly urls to advanced, did try to change to Mod Rewrite Friendly URLs but no can do as I got me problem with forums which contain in titles non latin characters... errors everywhere..

not sure is it any good from basic to advanced but... just to mention if this by any chance can help

final kaoss
14 Sep 2013, 16:00
Hi for using the htaccess, this step is pretty much necessary.
http://www.vbulletin.org/forum/showpost.php?p=2226244&postcount=3
That tends to help resolve most of the content saving issues & stuff like that. GL

goxy63
14 Sep 2013, 16:51
Missed that one, just set disabled content caching in adminCP, will test it out...looks like that was the problem

using code from zip now

Thanks a lot :]

final kaoss
16 Sep 2013, 01:30
No problem mate, if anyone has any issues or questions, don't hesitate to post!

goxy63
16 Sep 2013, 09:35
Me again :o
While testing on http://tools.pingdom.com/
Got me some 404 errors
lastpost-right.png
php.png
sections.png
users_online.png

and so on, about 20, all images
edited:
something is wrong, now more 404's

strange thing is that once i test page i got me those errors, than i test again than no errors, than again errors...

Thank you

final kaoss
16 Sep 2013, 12:58
Everything appears to be in working order as far as I can see.
http://www.webpagetest.org/result/130916_JJ_D5S/
If testing any other pages, the color coding helps a bit, keep an eye out for results marked red from this testing site.

goxy63
16 Sep 2013, 13:44
yes, just wondering why that test AT http://tools.pingdom.com show's me sometimes [not every time] those 404's for images and some other stuff, and sometimes same site for testing shows its all ok

thanks, your .htaccess code rocks :D

joeychgo
16 Sep 2013, 14:02
Koss - since this article is more then 2 years old, maybe its time to revise it and make a new article?

final kaoss
16 Sep 2013, 14:21
It's been revised every now & then and I feel it's a pretty near complete guide set out to speed up vbulletin as intended. For the most part, there simply isn't much more to add to it :)
http://gtmetrix.com/reports/www.video-game-chat.com/fokotAjK
I think a pagescore of 98 is about as close as it'll get when it comes to dealing with vbulletin. You can always throw in suggestions of course though.

DemOnstar
17 Sep 2013, 07:23
I am completely baffled by what I see here

http://www.webpagetest.org/result/130917_2F_7ME/1/details/

http://gtmetrix.com/reports/www.mightymoiety.com/6lRw4ubE

Am I in need of improvements?

final kaoss
17 Sep 2013, 13:09
I'm pretty sure this is a bug with internet explorer when selecting your browser choice in WPT.
Testing with chrome comes out with some different results.
http://www.webpagetest.org/performance_optimization.php?test=130917_3M_GWF&run=1&cached=0
Using both of the results to examine what's going on with your site it looks like both can agree that caching is the biggest issue for you... and that by itself can save lots of bandwidth/server resources.

goxy63
29 Sep 2013, 16:40
I am having some minor problems with videos streaming on my site, can this code in some way interfere with streaming players?
Problem for me is that when I load several pages with videos [on some pages few videos, articles mostly] in short time players got frozen, thay cant load video...when cache is cleared everything is ok.
Maybe it is cause my host, this code or...I don't have any idea?

final kaoss
29 Sep 2013, 17:34
I've never had any issue like that, I would guess that it's your browser or ISP. Just tested it with a video and had no problems.
http://www.video-game-chat.com/forum/nes-chat/22933-the-power-glove-by-the-angry-video-game-nerd.html#.UkhWUoafjy0

jl255
10 Oct 2013, 10:30
Step 2: Combine Javascript and Minify Javascript & CSS and Minify HTML.
Not compatible with VB3

how can i implement this on vb3.8.7?

--------------- Added 1381399326 at 1381399326 ---------------

how do i go about enabling compression? I did some research and found the following but have no idea which to implement.
http://httpd.apache.org/docs/current/mod/mod_deflate.html

final kaoss
10 Oct 2013, 12:58
Hi there, compression is already available in that .htaccess However your host may not have it enabled which would be the best explanation. Another reason it may not work is if you're using somthing other than apache, like nginx.

As for combining js & css, I don't believe there is a mod available for that (I haven't checked because I just don't use vb3 anymore). But there are alternative tools that you can try that claim to get the job done.
http://www.vbulletin.org/forum/showthread.php?p=2450760#post2450760

Also it looks like you should toss a copy of the htaccess into this folder.
http://cdn.forums.sgclub.com

http://gtmetrix.com/reports/forums.sgclub.com/jhstK2e6

Looking at your test, it appears that compression is indeed enabled.... Just be aware that most offsite elements are likely to fail on these kinds of tests and you don't have much control over them when it comes to compression & caching but you can always throw in a defer tag to see if it helps them.

Also I haven't tried to login to your forum but if you're having some login issues (most people do...) be sure to do this step too.
http://www.vbulletin.org/forum/showpost.php?p=2226244&postcount=3

One last thing... if you want to see more improvement I would cut down on the external resources.... You have alot, way more than the average site! I would suggest you have a look at these and decide which one's you don't need anymore. I see quite a bit of urls with "cdn" in their name, try running your site for 1 day without any cdn's transferring data, I would bet you would see improvements.
http://www.webpagetest.org/domains.php?test=131010_V4_E9C&run=1&cached=0

jl255
11 Oct 2013, 06:04
i've already used the htaccess you recommended, but it still says browser caching is not enabled? was there something wrong with my implementation?

final kaoss
11 Oct 2013, 13:09
Like I said, it will report that off site resources are probably not cached, gzipped etc. Since they're not on your server, you can ignore those. You will have to contact whoever you're using the third party scripts from and inquire to them about the issue.

Also your page is scoring much better now.
http://gtmetrix.com/reports/forums.sgclub.com/ctKQgbgq

blackberry
11 Oct 2013, 20:56
Mod Rewrite Friendly URLs doesnt open any thread or forum.. using vbseo + vb4suite

final kaoss
11 Oct 2013, 21:33
Hi, did you insert the proper friendly url rewrite rules from your old htaccess into the new one? I'm using vb4 (minus suite) with vbseo just fine.

final kaoss
12 Oct 2013, 20:06
Ah I see your problem now. I just double checked and and have mine set to Standard URLs in admin cp with vbseo enabled.

blackberry
13 Oct 2013, 09:41
Ah I see your problem now. I just double checked and and have mine set to Standard URLs in admin cp with vbseo enabled.
Ok thats fine i can see the main page,but not able to login @forum .. all the members, i did Disable Content Caching --> Yes

Loading of pages is really slow, profiles and groups aren't opening
"The page isn't redirecting properly" -->http://sachiidosti.com/forum/groups/

final kaoss
13 Oct 2013, 15:19
They're opening fine for me using google chrome & firefox.

Also you have over 400 requests on every page. You might want to trim that down as each request adds to the load time.
http://www.webpagetest.org/result/131010_V4_E9C/

Comparing it to my site, mine only makes 28 requests on every page load and if a user is returning then it's only 18 requests for them. Refer to what I said earlier about cutting back on third party scripts or they will continue to put a burden on your site.

Also it looks like you have alot of active members who may be posting images from third party hosts. This addon can help to localize them & reduce page load time for returning visitors.
http://www.vbulletin.org/forum/showthread.php?t=253309

It looks like if you hosted the images on your domain instead of photobucket you could shave off 71KB... quite a bit.
Also if you scale the images you can save over 480KB... all in all around half a megabyte.
This article can help you with image scaling since you use vbseo http://www.vbulletin.org/forum/showthread.php?t=276910

And finally if you defer the parsing of javascript... as I mentioned in another post, you can save another 190KB or so worth of bandwidth.

In order to load a page, the browser must parse the contents of all <script> tags, which adds additional time to the page load. By minimizing the amount of JavaScript needed to render the page, and deferring parsing of unneeded JavaScript until it needs to be executed, you can reduce the initial load time of your page.

blackberry
13 Oct 2013, 20:21
They're opening fine for me using google chrome & firefox.

Also you have over 400 requests on every page. You might want to trim that down as each request adds to the load time.
http://www.webpagetest.org/result/131010_V4_E9C/

Comparing it to my site, mine only makes 28 requests on every page load and if a user is returning then it's only 18 requests for them. Refer to what I said earlier about cutting back on third party scripts or they will continue to put a burden on your site.

Also it looks like you have alot of active members who may be posting images from third party hosts. This addon can help to localize them & reduce page load time for returning visitors.
http://www.vbulletin.org/forum/showthread.php?t=253309

It looks like if you hosted the images on your domain instead of photobucket you could shave off 71KB... quite a bit.
Also if you scale the images you can save over 480KB... all in all around half a megabyte.
This article can help you with image scaling since you use vbseo http://www.vbulletin.org/forum/showthread.php?t=276910

And finally if you defer the parsing of javascript... as I mentioned in another post, you can save another 190KB or so worth of bandwidth.
its opening because m using the old hta .. no one was able to login so i changed it :mad:

thank you for the tips :up:

final kaoss
14 Oct 2013, 13:53
Good to see that you got your issues fixed. Let me know if you need help with anything else.

final kaoss
18 Nov 2013, 13:22
Update: A bit more security has been added to the .htaccess on the first post. This has been attributed properly to http://bodvoc.com/

Disco_Dave
22 Nov 2013, 14:58
Can this, and the other mods recommended in this article still work with 4.2.2?

Dave

final kaoss
22 Nov 2013, 17:35
Yes, I still use them including the supercharged plugin, (except for the sprite mod) on my vb 4.2.2

Disco_Dave
23 Nov 2013, 11:03
I'll give it another shot, it messes with my style a good bit, and I'm not 100% sure I have the skills to fix it......

final kaoss
23 Nov 2013, 16:20
Turns out that there's quite a few issues with the sprite mod and I've marked it optional as such. Instead of going for that, I use lazy load images, which I've included a link to in the first post.

If you want to pursue getting the sprite mod to work, GL!

mathforum
24 Nov 2013, 05:42
I've tried out lots of things in this thread over the past couple of years and overall it's been really helpful so thank you first of all. :)

After researching and researching it seems like vB biggest problem is loading javascript in a bad way that doesn't allow parallel downloading when going through the html header. I've chatted with you about ways to try to compress the JS files but I'm not confident I can do that correctly. It seems like if there were a good fix for the JS files then it would be available, right?

What I do think is a good idea is using a CDN to load the CSS and JS. Images should go there too but I think the first two file types cause the biggest problems. Now there are lots of options out there for CDNs but I believe it's possible to mimic a CDN by creating a subdomain on one's own site to load from. Is that correct? If so, do you know of anyone doing this for a vB forum?

Here is my gtmetrix report (http://gtmetrix.com/reports/mathhelpboards.com/5dPa96VY) if you are interested. Our load time is horrible according to them but for me it's usually lightning quick to load. I feel like Google Adsense will add one 1-2 seconds to a page sometimes but the real content is already loaded by then.

Max Taxable
24 Nov 2013, 05:53
I believe it's possible to mimic a CDN by creating a subdomain on one's own site to load from. Is that correct? If so, do you know of anyone doing this for a vB forum?I have seen that done and it does not help speed at all, it's simply not a Content Delivery Network - in the end it's just another folder on your same host. :)Here is my gtmetrix report (http://gtmetrix.com/reports/mathhelpboards.com/5dPa96VY) if you are interested. Our load time is horrible according to them but for me it's usually lightning quick to load. I feel like Google Adsense will add one 1-2 seconds to a page sometimes but the real content is already loaded by then.I use ONLY the Patrick Meehan webpagetest site (Meehan is Google's Tech head.) They're not selling ANYTHING there... Most sites that give you a bad report, are. Webpagetest is ALL about education.

Here's a test I just did on you, the pageload is not too shabby for a site loading 111 requests.... This was with a IE10 browser on cable internet, Dulles VA. You can choose any browser, dozens of locations and connection types.

http://www.webpagetest.org/result/131124_WS_5SN/

As you can see by clicking on the waterfall view, your js is cascading parallel, just fine and dandy for IE10.

mathforum
24 Nov 2013, 06:12
Thank you again for your comments :)

I've used WebPagetest before many times in addition to some others. The output of it isn't as clear as to what steps can be made to improve issues like on gtmetrix or YSlow. Nevertheless, the main issues are pretty clear to me concerning vB - loading static content better.

It's interesting you say that the JS files are actually loading in parallel, which is something I thought was a big problem for vB. I also have a handful of other JS code/files related to Tapatalk and Mathjax. In terms of just moving all JS, CSS and images to a CDN without any further tweaking - how much of an improvement do you think this could make? I really wish we had some "before and after" data to look at.

Trying to make real changes to my site that result in better speeds is something that has been like a theoretical marathon of reading about different strategies but not knowing how to do them. I would like to try to implement something at last, but need guidance where to start.

Max Taxable
24 Nov 2013, 06:20
Thank you again for your comments :)

I've used WebPagetest before many times in addition to some others. The output of it isn't as clear as to what steps can be made to improve issues like on gtmetrix or YSlow. Nevertheless, the main issues are pretty clear to me concerning vB - loading static content better.

It's interesting you say that the JS files are actually loading in parallel, which is something I thought was a big problem for vB. I also have a handful of other JS code/files related to Tapatalk and Mathjax. In terms of just moving all JS, CSS and images to a CDN without any further tweaking - how much of an improvement do you think this could make? I really wish we had some "before and after" data to look at.

Trying to make real changes to my site that result in better speeds is something that has been like a theoretical marathon of reading about different strategies but not knowing how to do them. I would like to try to implement something at last, but need guidance where to start.Keeping consistent with your testing is key to seeing before/after results. These Meehan tests stay up - you can bookmark them. You can repeat them with exact parameters. Compare results of changes. Over time. Like I said that is all I use - keeping the test variables and conditions to a minimum.

You'll see when you click on the waterfall view of your test, what I am talking about re: your js files cascading parallel nicely. Then run the test using a IE6 or 7 or 8 browser and you will see them, NOT do that. Older browsers just can't load js parallel.

There's all kinds of tutorials based on your specific tests, at Meehan. There's also a message board community there not unlike this one, with many knowledgeable volunteer helpers like alot of the folks here at vB dot org. :D

mathforum
24 Nov 2013, 07:00
The thing is we are all using the same base code for vB 4.x.x and most of the techniques for improving performance should be applicable to everyone else I would think. I'm not against doing tests and gathering data, in fact I enjoy that sort of thing, but I don't have an idea of where to start.

I just checked out http://www.video-game-chat.com/forum/ which is the website of the author of this article and I'm thrilled to see a super fast loading time and a great Webpagetest report. I wonder why he has so little files to load compared to my site?

Ok I'll start with double checking my .htaccess file. vbsupercharged is EOL so can't use that and the CSS Sprites program has issues according to this thread. That pretty much leaves using a CDN and Lazy load images right?

Max Taxable
24 Nov 2013, 07:34
I just checked out http://www.video-game-chat.com/forum/ which is the website of the author of this article and I'm thrilled to see a super fast loading time and a great Webpagetest report. I wonder why he has so little files to load compared to my site?

Because like me, he is not running any adverts. He also like me, has a very simple skin design that doesn't have a million large kb images associated with it. I'm only faster than him because I run vB 3.8.:D

Every image, every advert, and alot of the mods you might install, are going to have their calls in the script. It can add up really quickly and bog your site down - it's one of the reasons your first byte time is relatively slow too. You have a heavy web page. Over 1,000 kb loaded there.

Look at the waterfall in detail, look at what all of your 111 calls are. Default vBulletin out of the box only has 30 calls or so....

http://www.webpagetest.org/result/131124_WS_5SN/1/details/

At the bottom of the waterfall, click on "View all images" to get details on all your image sizes, whether they are compressed or not, and so on.


By contrast, he's got TINY images that he sizes in the script, they don't load very many kb on a browser.

http://www.webpagetest.org/pageimages.php?test=131124_5E_77V&run=1&cached=0



Here's me. You don't need a CDN to be greasy fast.

http://www.webpagetest.org/result/131124_X8_7E5/

mathforum
24 Nov 2013, 09:36
Very interesting to see the images displayed like that! Thank you for showing me this option.

You make a good point. My custom design is heavy with pictures and we do have a decent amount of mods running that might not be optimized for speed. The number of requests is just too high I think. I don't know how to do this, but combining images lots of the tinier images into a sprite would be helpful. Luckily on the homepage there's only one modification that adds a lot of js and requests, but I can't get rid of it so that is what it is. Google ads are also being a bit annoying with the number of files and images running each time. :mad:

Speaking of sprites, it seems the mod referenced in this article might still work for vB 4.2.0, the version we have. I'm worried about all of our custom images not working with the code but I'll give it a shot. If you have any advice on this I am all ears, otherwise I'll do my best to use the directions plus support thread.

This has been a good discussion because I'm now seeing more details than I was before and in a more useful way. Maybe my misunderstandings can be useful to others who also don't know how apply the advice here.

final kaoss
24 Nov 2013, 14:51
Alot of images can slow a site down alot. Using Lazy Load, you can help reduce the load for guests... idk about search bots. As it loads images as the user scrolls down, meaning they can load many of the other static elements first. As for optimizing images, there's a few on the OP that don't reduce the quality, just the kb of the images; aka lossless image optimization.

As for using mods that you feel aren't optimized, for those that use js, you can run them through a javascript compressor online like this one (http://javascriptcompressor.com/).

You can give the sprite mod a chance if you want but it gives users hell just to get the thing running and some people can't get it to run at all! Which is why I don't recommend it.

I think the last thing you need to do is play around with deferring js... but don't go crazy with it, some core js just won't work if you try to defer it and cause you issues. It's been a while since I dabbled with it, so if you can report your findings on that here... it would help alot!

The easiest way to remember to do this is to insert it in the first script tag before it closes like so.

<script src="some_javascript.js" defer>

Max Taxable
24 Nov 2013, 17:39
Luckily on the homepage there's only one modification that adds a lot of js and requests, but I can't get rid of it so that is what it is. You might even make a decision like I did, <if> conditionals which hide certain mods, products and/or plugins from the unregistered/not logged in usergroup. Really works wonders. In vB3 it's <if condition: $show member> or some such. This conditional would be added to whatever template the Mod is called in. Your membership still gets all the fancy toys and doodads - once they are logged in. Ask yourself what benefit the Mod has for the visitor, for SEO, spiders and so on. Do those perceived benefits outweigh the cost in added load time, amount of extra requests, and bytes delivered? Do the Mods help or hurt the SEO? And so forth.

The most important thing to remember about page load speed is not to get too bogged down in it. Make a strategic decision about how much work you want to do vs. the perceived benefits. For example, there is still alot I could do to make my site even faster than it is, but I reached the point of diminishing returns pretty quickly and still have decent results. You just have to set attainable goals, do the easier stuff first, then re-evaluate as you go along.

Like alot of stuff of webmastering, it's about personal preferences.

final kaoss
03 Jan 2014, 17:40
Yep, my guide covers pretty much all you need to do. There are other things you can pursue if you wish but really, it's up to you to put in the time to try to go after the other stuff, which really won't help all that much in terms of performance.

goxy63
17 Jan 2014, 10:44
Hi

I am having some weird problem with "404 Not Found nginx"

Was thinking to ask is it somehow related with this code here, I guess it might be but I am not that good with all this

In fact I think its somehow related with ads which I host from http://yllix.com/
Problem always occurs in place where ads are presented, but its always random, for some users problem is there and for some of them like me its not...its weird

those 404 nginx and these
http://lp.sharelive.net/?sysid=406&appid=1316&subid=ams1CLWmhZXG8eD8fhACGJOa4uTFo8vebyINMTA5LjkzLjExMy4xNigBMJ-N5JYF

any suggestions?

Some users when open my forums they got this issue at once

http://www.zaliv.co/forum.php

Dave
17 Jan 2014, 11:58
Hi

I am having some weird problem with "404 Not Found nginx"

Was thinking to ask is it somehow related with this code here, I guess it might be but I am not that good with all this

In fact I think its somehow related with ads which I host from http://yllix.com/
Problem always occurs in place where ads are presented, but its always random, for some users problem is there and for some of them like me its not...its weird

those 404 nginx and these
http://lp.sharelive.net/?sysid=406&appid=1316&subid=ams1CLWmhZXG8eD8fhACGJOa4uTFo8vebyINMTA5LjkzLjExMy4xNigBMJ-N5JYF

any suggestions?

Some users when open my forums they got this issue at once

http://www.zaliv.co/forum.php

Most likely caused by the mod rewrite friendly URL's, this is for Apache and not nginx.

final kaoss
19 Jan 2014, 03:08
Updated the first post to include the jpegmini tool!

goxy63
20 Jan 2014, 15:07
Updated the first post to include the jpegmini tool!

new code was producing me a bug, when someone send you pm... notification appears again even after you read it....changed back to old code...

final kaoss
20 Jan 2014, 20:01
Sounds to me like you missed this step.
http://www.vbulletin.org/forum/showpost.php?p=2226244&postcount=3
Also like others have stated, the htaccess is NOT for nginx.

new code was producing me a bug, when someone send you pm... notification appears again even after you read it....changed back to old code...

ozzy47
06 Mar 2014, 03:20
@final kaoss, if I PM you my .htaccess, could you take a look at it, and clean it up a bit? It is working pretty dang good, but I think it looks like a mess, and you may see something that may need tweaking.

final kaoss
06 Mar 2014, 14:52
Go ahead I can have a look at it.

tbworld
06 Mar 2014, 16:15
I think it looks like a mess

People should always view my messes as 'art in progress'. :)

ozzy47
10 Mar 2014, 00:46
Here is my latest results for my site, pretty frigging good for vB4, http://www.webpagetest.org/result/140309_D0_RWZ/

final kaoss
10 Mar 2014, 02:25
Now if only vb.org did some of the changes :)
http://www.webpagetest.org/result/140310_RR_1G9/

ozzy47
10 Mar 2014, 02:26
Yeah it could use some tweaking, but it is vB3, so it loads quickly.

Max Taxable
10 Mar 2014, 03:47
Now if only vb.org did some of the changes :)
http://www.webpagetest.org/result/140310_RR_1G9/They have some images that need to be optimized, and some they really can't control because they are avatars.

But when we test their home page, we see result without avatars and the images they need to optimize are listed: http://www.webpagetest.org/result/140310_Q5_2XX/1/performance_optimization/#compress_images

But it only winds up being a savings of 4.8kb, hardly seems worth the effort just to get a A grade on that..

However they're not caching static assets very well.Leverage browser caching of static assets: 3/100

FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/redstyle.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/whitestyle.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/greenstyle.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/bluestyle.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/purplestyle.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/misc/stats.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/misc/birthday.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/misc/menu_open.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/header.jpg
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/tcat.jpg
FAILED - (No max-age or expires) - http://www.vbulletin.org/favicon.ico
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/bottomshade.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/headbg.jpg
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/vheader.jpg
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/button2.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/misc/whos_online.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/buttons/collapse_thead.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/clientscript/vbulletin_menu.js?v=3612
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/vblogo.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/clientscript/vborg_miscactions.js?v=3612
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/clientscript/blue.css
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/clientscript/vbulletin_global.js?v=3612
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/clientscript/vbulletin_md5.js?v=3612
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/bodybkgd950px.jpg
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/buttons/lastpost.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/clientscript/vbulletin_read_marker.js?v=3612
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/statusicon/subforum_old.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/statusicon/forum_old.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/misc/navbits_start.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum/images/cstyle/blue/buttons/collapse_tcat.gif
FAILED - (No max-age or expires) - http://www.vbulletin.org/forum

And that's a very easy .htaccess fix. (http://ozzmodz.com/showthread.php/1363-Quick-and-easy-way-to-leverage-browser-caching-of-static-assets)

But with only 90 total KB loaded and only 34 requests, it's not nearly as bad as the grades might seem to make it look.

It's about 15 minutes work to fix everything here and get straight A grades.

final kaoss
10 Mar 2014, 12:54
It wouldn't even take 15 minutes to apply the caching. Maybe 1-3 at most depending on who's modifying it :) but yeah that is one of the big issues is not having their static elements being cached.

bzcomputers
22 Mar 2014, 07:05
I noticed a couple issues at the bottom of the last two sections in the suggested .htaccess file:

# 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})
*** ADD RULE HERE***
##
##&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]
*** ADD RULE HERE***
#
## End of commented Rewrite directives
#

The problem with this is you have all these rewrite conditions then at the end you don't have a rewrite rule. You need to add something like this:

# Send all blocked requests to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]

In the two spots where I placed *** ADD RULE HERE*** in the code block above.

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

...also suggest a slight change to this line:
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]

to this:
# Block out any script trying to base64_encode or base64_decode data via URL
RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [OR]

Disco_Dave
22 Mar 2014, 10:57
I noticed a couple issues at the bottom of the last two sections in the suggested .htaccess file:

# 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})
*** ADD RULE HERE***
##
##&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]
*** ADD RULE HERE***
#
## End of commented Rewrite directives
#

The problem with this is you have all these rewrite conditions then at the end you don't have a rewrite rule. You need to add something like this:

# Send all blocked requests to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]

In the two spots where I placed *** ADD RULE HERE*** in the code block above.

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

...also suggest a slight change to this line:
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]

to this:
# Block out any script trying to base64_encode or base64_decode data via URL
RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [OR]


I use this one also, I wonder if there's something in mine that stops my dbseocp panel taking me back to the ACP.....I need one you guys to may be run your eyes over mine :)

bzcomputers
22 Mar 2014, 17:39
I use this one also, I wonder if there's something in mine that stops my dbseocp panel taking me back to the ACP.....I need one you guys to may be run your eyes over mine :)

PM me a copy and I'll look at it.

tpearl5
31 Mar 2014, 21:00
remember, you really have no reason to use mod_deflate if your server is already set to use gzip.

final kaoss
31 Mar 2014, 22:27
You'll be just fine using mod_deflate. Just turn off vbulletin's gzip function otherwise, you'll be increasing load for no reason plus I don't believe vbulletins gzip feature covers everything.

The mod_deflate module is similar to mod_gzip, but usable only with Apache v2. Early versions of mod_deflate provided lesser amount of compression than mod_gzip.[2] Starting with Apache 2.0.45, the compression level of mod_deflate is configurable using the DeflateCompressionLevel directive, so this difference disappeared.
A mod_gz module was independently developed by Ian Holsman. This module implements a gzip compression filter for Apache 2.0, providing similar functionality to mod_gzip. One important difference between the two modules is that mod_gzip includes its own gzip implementation, whereas mod_gz relies on an external zlib library.

tpearl5
31 Mar 2014, 23:00
You'll be just fine using mod_deflate. Just turn off vbulletin's gzip function otherwise, you'll be increasing load for no reason plus I don't believe vbulletins gzip feature covers everything.

Right. I meant server level gzip. In other words, a lot of hosts already have things configured in httpd.conf. Some already have them configured with mod_deflate too.

Firyou
08 Apr 2014, 10:03
Nice tutorial Final Kaoss. I'm currently looking to add those modifications to my .htaccess file. Currently when I open up that file in my public_html for the root of the site, I see just these two lines in the file


Options +FollowSymLinks
Options +SymLinksIfOwnerMatch


Is this the right location on where to add the changes? I have never modified this file in the past and I didn't create it either, it was there already. Tyia

I also have vb 4.2.0 pl4

final kaoss
08 Apr 2014, 13:05
You want to have the htaccess in the same folder as your vbulletin installation. So if you have your vbulletin installed in the default public_html, then yes that's the right place to modify that htaccess file. Otherwise, move the htaccess to the vb install and then modify it.

Mike0
28 Apr 2014, 04:13
The line ExpiresByType text/html A3600 causes issues with logging in.

final kaoss
07 Jun 2014, 17:59
I've tested with removing that line and it makes no difference. Refer to post 3 for the fix.

Fields
13 Mar 2015, 11:00
One of the best articles here, thanks for this!

I have just several small problems:

When I read a thread, the statusicon on FORUMHOME still displays new posts.
When I delete a PM, I also need to reload the page in order to make the PM vanish.
When I move a thread to an other forum, it's still displayed in the same forum until I am reloading.

etc. etc.

Do you know how to fix this?

I am using vB 4.2.2 PL4, DBSEO and vB Optimise.

TheLastSuperman
20 Mar 2015, 20:50
One of the best articles here, thanks for this!

I have just several small problems:

When I read a thread, the statusicon on FORUMHOME still displays new posts.
When I delete a PM, I also need to reload the page in order to make the PM vanish.
When I move a thread to an other forum, it's still displayed in the same forum until I am reloading.

etc. etc.

Do you know how to fix this?

I am using vB 4.2.2 PL4, DBSEO and vB Optimise.

vB Optimise is a good mod, I have however ran into some very odd issues with it in the past so with that being said try simply disabling it then clearing your system cache - now check to see if the display issues are resolved. If yes then its something with vB Optimise if not then re-enable the mod and keep checking.

final kaoss
01 Mar 2018, 06:48
A few small edits were made.

Also it's worth noting that if you use cloudflare, you can ignore the compression settings in the article & let cloudflare handle it.

With Brotli, it should deliver better performance but it requires https to be enabled (https://www.vbulletin.org/forum/showthread.php?t=326118).

bigrover
23 Apr 2018, 04:26
I'm trying to apply these instructions to a test vb 4.2.5 site but I can't get past changing the Friendly URL's from Basic to Mod Rewrite Friendly Rules. When I do this I lose access to my forums. I can display the forum home, but when I click on any forum or category below that I get the following message:

Not Found
The requested URL /vb/forums/7-xxxxx was not found on this server.

Apache/2.4.7 (Ubuntu) Server at thetestsite.org Port 80

My current .htaccess file is:

# To redirect all users to access the site WITH and WITHOUT the www. prefix
# to the /vb subdirectory

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.thetestsite\.org$ [NC]
RewriteRule ^(.*)$ http://thetestsite.org/$1 [L,R=301]

redirect /index.html http://thetestsite.org/vb/index.php

Where am I going wrong?

final kaoss
23 Apr 2018, 17:11
On the first post where it says to add your rewrite rules, these are the default ones that you can use for compatability with the Mod Rewrite Friendly Rules. Simply throw this in, in between these lines.

#add your friendly url rewrite rules below.

#stop adding your friendly url rewrite rules here.


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]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]

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

RewriteRule ^.*$ - [NC,L]

# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]

# Check MVC result
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ - [NC,L]
RewriteRule ^(.*)$ - [R=404,L]

bigrover
24 Apr 2018, 05:25
Thank you for the help. I also found this .htaccess file has to be in the apllication directory, not in the root of the domain where I kept putting it. Things are working now, so I am moving on to step 2.

bigrover
11 May 2018, 23:31
In step 2 of the guide, there is discussion about optimizing attachments, avatars, and such. I know in the tables that point to the attachment files the file size is recorded. If the attachments are compressed, the size will change. How does the size get corrected, or does it matter?

final kaoss
13 May 2018, 04:39
I'm not sure about that, I store my attachments as files. I don't think there's a tool in maintenance to update the attachment storage.

Even if it does miscount after you optimize some images, it shouldn't matter if you have infinite storage for attachments anyways.

Attachments are currently being stored in the filesystem at ./attachments