View Full Version : Board Optimization - Combine It - Javascript and CSS optimization
Menewsha
12-03-2009, 10:00 PM
What does it do?
This mod is designed to automatically merge and minify all CSS and Javascript on the board and cache the result. This helps reduce requests to the server and reduces bandwidth usage.
Installation
Upload contents of upload folder to forum
Create a folder named 'cache' in the forum
Make sure the web server has the appropriate permissions to write to the cache folder
Import product-combineit.xml into vBulletin
Edit options under vBulletin options to reflect how you want the mod to act and to activate it
Notes
This may not work with highly customized CSS or Javascript. If the script can't write to the cache folder this mod will not function. If you find problems with the order a particular script is executing in, add it's filename as a stop word and it'll load as usual.
saadessa
12-04-2009, 11:14 PM
thank you alot i need this hack iwas look for like this ..... installed
Menewsha
12-04-2009, 11:21 PM
Updated to fix potential vbSEO issue, and to allow the option of not optimizing inline CSS.
If anyone has any suggestions please feel free to post them.
Scalemotorcars
12-04-2009, 11:37 PM
Will be looking into this. Could be very handy for heavily modified boards. Thanks.. :up:
AzzidReign
12-05-2009, 02:00 AM
Nice! Glad this is not for 4.0 (yet) as I'm going to be on 3.8 for a lil while still!
digicom
12-05-2009, 02:02 AM
Installed! thanks for this :up:
euantor
12-05-2009, 07:17 AM
Thanks tons :D Going to try it out now.
abdobasha2004
12-05-2009, 11:42 AM
woooow
great
nominated + installed
abdobasha2004
12-05-2009, 12:03 PM
Make sure the web server has the appropriate permissions to write to the cache folder
what permissions?
777?
or 775?
abdobasha2004
12-05-2009, 12:20 PM
how to know it is working?
Menewsha
12-05-2009, 06:31 PM
what permissions?
777?
or 775?
Depends on your web server, but 777 should definitely work without any issues.
how to know it is working?
Look in your page source, you should see a reference to /cache/{somenumber}.css and a .js in the same format. If it's not doing that then there are two possible causes. 1) Some of your js or css files are 401/404 or 2) you haven't set any options for it.
ishare
12-05-2009, 09:18 PM
MGC Chat is not loading the conversations and stopped working.
Front Page Slide Show (FPSS) on vB Advanced stopped loading pictures.
It looks great. I hope i can find a way to solve my problems..
And thanks for this great hack..
mbc100
12-06-2009, 10:18 AM
nice mode thanks
Menewsha
12-07-2009, 09:16 PM
MGC Chat is not loading the conversations and stopped working.
Front Page Slide Show (FPSS) on vB Advanced stopped loading pictures.
It looks great. I hope i can find a way to solve my problems..
And thanks for this great hack..
Put the js filenames for each broken mod into the stopwords field and it should work.
abdobasha2004
12-08-2009, 06:54 PM
Look in your page source, you should see a reference to /cache/{somenumber}.css and a .js in the same format. If it's not doing that then there are two possible causes. 1) Some of your js or css files are 401/404 or 2) you haven't set any options for it.
this did not work
I am using the mod for vb 3.7
and I am caching js and css with htaccess
however there is a file named "112389241.css" in cache folder
but there is no such file in page source !
can you give optimum settings?
Dave-ahfb
12-08-2009, 08:35 PM
This does not work.
As the person above I have just a small css file, missing all of the relevant css, and no call to cache in the source.
Funny thing is all those giving praise I went to your sites and none have it working.
Audax666
12-09-2009, 08:28 AM
Also the javascript in the member.php is disabled, so no tabs are displayed. Even if I disable very function in the vb settings. I'm not a developer for that I really can't measure any speed increase.
Felt speed increase=0
But I wish it would, so keep on working on it. :up:
Menewsha
12-09-2009, 08:46 PM
this did not work
I am using the mod for vb 3.7
and I am caching js and css with htaccess
however there is a file named "112389241.css" in cache folder
but there is no such file in page source !
can you give optimum settings?
The optimal settings are in the screenshot. I'll take a look at your forum a little later and see if I can work out what might be creating an issue.
This does not work.
As the person above I have just a small css file, missing all of the relevant css, and no call to cache in the source.
Funny thing is all those giving praise I went to your sites and none have it working.
If you'd like to show me your settings I'd love to see if I can work out what the issue is for you. It's not exactly meant to be the most novice of mods.
Also the javascript in the member.php is disabled, so no tabs are displayed. Even if I disable very function in the vb settings. I'm not a developer for that I really can't measure any speed increase.
Felt speed increase=0
But I wish it would, so keep on working on it. :up:
The speed increase from the mod is meant to be aimed at first time visitors more so than repeat visitors who would always have those files cached. It also aims to reduce bandwidth on those files in the first place with minifying them. If you'd like to compare you can always install the firefox page speed mod google provides and test it from there. The motivation for this mod was googles recent public expression that they are rewarding pages that load faster, and one of their recommendations is to limit and minify the javascript/css on page, and combine them into fewer files, of which this mod does.
FWIW, I just updated the version to now allow people to only minify CSS in case there are too many Javascript issues.
digicom
12-10-2009, 12:08 AM
updated it but still shows as Version 1.0
abdobasha2004
12-10-2009, 11:42 PM
it seems no body have managed to work with it
if it really works it would be gr8
Menewsha
12-11-2009, 07:56 PM
For those of you who want to see an example forum www.menewsha.com though CSS is the only one being minified right now while I make some modifications.
abdobasha2004
12-11-2009, 08:46 PM
For those of you who want to see an example forum www.menewsha.com though CSS is the only one being minified right now while I make some modifications.
so why it is not working for me ?
http://100fm6.com/vb/
Dave-ahfb
12-11-2009, 09:55 PM
I thought it was supposed to merge the css as well as minify.
yahooooh
12-25-2009, 10:22 PM
any update?
alhindasi
12-28-2009, 05:10 AM
installed but not woorking good
we need new update please
alhindasi
12-28-2009, 04:00 PM
AJAX not Working Need to be checked and Fixed
Rafa-el
03-12-2010, 12:21 PM
vB 3.8.5 support?
Brandon Sheley
03-13-2010, 01:39 AM
I'll have to check this one out, looks good
extremeseo
03-15-2010, 08:05 AM
What is the recommended setting for
Javascript caching
How long should the javascript be cached for?
300 or 3600 ?
ps2wiz
05-16-2010, 03:51 AM
vB 3.8.5 support?
Doesn't seem to work for me.
budlight
07-08-2010, 01:48 AM
What is the recommended setting for
Javascript caching
How long should the javascript be cached for?
300 or 3600 ?
assuming seconds 3600 is super low that's one hour. How often would your js even change. You'd prob easily be safe with 12-24 hours and possibly even more.
Hellmaster
07-08-2010, 03:24 AM
How much is "highly" customized CSS or Javascript?
10 JS mods?
100 JS mods?
budlight
07-10-2010, 03:15 PM
just try it man nobody can know till you try it
imedic
07-14-2010, 05:47 PM
I have installed it and it works (only with 777 on cache) but fast edit does not work. It sends you to full edit form the first click.
Can this be put as an exclusion in the settings?
It seems there are many problems with posting (bold, smilies ... ) uninstalled for the moment.
EDIT: I will love too have this working on my site as is clear: google wants pages loading fast and aren't we all happy to please google :D
merkaz
07-31-2010, 06:51 AM
Great mod . thanks .
merkaz
07-31-2010, 07:05 AM
1 / Taps in members profiles not shown .
2/ Quick Reply not working .
webmastersitesi
10-10-2010, 02:07 PM
Does it work with 4.0?
snobbytec
11-20-2010, 07:31 AM
Installed, but i get an error at forum page
Fatal error: Uncaught exception 'JSMinException' with message 'Unterminated string literal.' in /var/www/vhosts/teccentral.de/httpdocs/forum/includes/php-min.php:94 Stack trace: #0 /var/www/vhosts/teccentral.de/httpdocs/forum/includes/php-min.php(235): JSMin->action(1) #1 /var/www/vhosts/teccentral.de/httpdocs/forum/includes/php-min.php(64): JSMin->min() #2 /var/www/vhosts/teccentral.de/httpdocs/forum/includes/combineit.php(177): JSMin::minify('<!DOCTYPE html ...') #3 /var/www/vhosts/teccentral.de/httpdocs/forum/includes/functions.php(5737) : eval()'d code(96): combineJS('<!DOCTYPE html ...') #4 /var/www/vhosts/teccentral.de/httpdocs/forum/includes/functions.php(5737): eval() #5 /var/www/vhosts/teccentral.de/httpdocs/forum/index.php(597) : eval()'d code(175): print_output('<!DOCTYPE html ...') #6 /var/www/vhosts/teccentral.de/httpdocs/forum/index.php(597): eval() #7 /var/www/vhosts/teccentral.de/httpdocs/forum/vbseo.php(1392): require('/var/www/vhosts...') #8 {main} thrown in /var/www/vhosts/teccentral.de/httpdocs/forum/includes/php-min.php on line 94
what can i do to fix it ?
vBulletin 3.8.4 , vBAdvanced works fine
oddmud
01-11-2011, 11:49 PM
Anything like this for v4.1 ?
briansol
02-02-2011, 02:32 AM
Anything like this for v4.1 ?
https://vborg.vbsupport.ru/showthread.php?t=229608
Marvin Hlavac
03-19-2011, 10:02 AM
Hi Menewsha,
Many thanks for creating this add-in, and for sharing it with us.
I have combined my .js files recently myself, but I didn't know how to combine my two .css files. I just installed your add-in, configured it to minify and combine only .css, and tested it. It worked!
Now, instead of two .css files, when I check my source I only see one. I'm very much grateful to you for this!
However, I run my site via a CDN (Content Delivery Network), and I need to find a way to change the URL
from:
www.example.com/cache/
to:
cdn.example.com/cache/
The method I use for changing URLs of other static content doesn't seem to work for the .css file generated by your product.
For other static content (.js, .jpg, .gif, and even my old .css files), I simply created a Replacement Variable in the Replacement Variable Manager, but creating one for www.example.com/cache/ ---> cdn.example.com/cache/ doesn't change the www to cdn.
Maybe the combineit.php should be edited somehow to address my specific requirement?
I still want the plug-in to save the combined .css to the same directory ( www.example.com/cache/ ), but I need the URL in the html of my page to be cdn.example.com/cache/
Any assistance with this would be greatly appreciated.
Kind regards,
Marvin
Marvin Hlavac
03-19-2011, 11:58 AM
I solved the above CDN-related issue by editing the line 101 of the combineit.php as follows:
$buffer = str_replace($first, '<link type="text/css" rel="stylesheet" href="'.'http://cdn.example.com'.'/cache/'.$hash.'.css" />'."\n", $buffer);
However, I came across an issue with WYSIWYG editor and FireFox web browser. When css files, including inline css, are combined, the WYSIWYG editor is not styled in FireFox (the background is gray instead of white, and fonts are different, too).
I think if it were possible to exclude individual css file(s) from being combined, this issue could perhaps be corrected by excluding vbulletin_editor.css. But I don't know if it would at all be possible to modify this product to exclude individual css files like it is possible to exclude js files.
Any feedback would be much appreciated.
Marvin Hlavac
03-20-2011, 10:44 AM
I have found the above mentioned issue, which causes FireFox not to style the reply box, to be related to hosting CSS on a CDN. So this issue is not the fault of this product. This product, as far as I can see, works flawlessly, combining .css files with not a single issue so far on my forum. This product is an unnoticed gem! I can't believe only 43 people marked it as installed to this day!
I may look into using it to also combine my .js files, even though I already combined some of them myself a while ago. I briefly enabled the .js feature, but while it did combine them all, and my pages displayed in my browser just fine, I did notice a yellow exclamation mark in the Internet Explorer's status bar notifying me of errors. This may be related to incompatibility of my own modifications though, so I may look into this at a later date. For now, I'm just very glad I can use it at least for the .css files.
Is anyone using this product successfully for combining .js files? Would you mind sharing your URL, or tell us if it worked for you with or w/out any modification(s) needed?
Hornstar
04-18-2011, 12:56 AM
Yeah I just found this too. Can't believe not more people are wanting such a feature working on their sites.
I will trial this in a little bit and fingers cross it works.
Marvin Hlavac
04-28-2011, 06:25 PM
After 6 weeks of using this add-on to combine just .CSS, I decided to use it also for combining .JS. (Previously I combined my .JS myself, but the way I was doing it wasn't as nice as using this add-in.)
It works. The only slight issue I observed was related to an add-in I use (Geek Auto Linker), but that was easily solved by adding the name of the javascript for Geek Auto Linker (gal.js) as a "stop word" in Combine IT.
So, as a conclusion I can say, Combine IT works, and it works very well. For many (most?) vBulletin installations Combine IT will likely work right out of the box.
SBlueman
05-01-2011, 09:37 PM
I seem to be having issues where members can't click on any quick reply options. Are others experiencing any issues with the quick reply?
Marvin Hlavac
05-01-2011, 11:31 PM
By "Quick Reply options" do you mean the formatting options such as bold, italic, underline, enter hyperlink, add image, etc? I haven't noticed these issues, and I just tested them on my forum.
To ID the cause if the issue, I'd start by first trying to find out if a .css or a .js file is causing it. Disable .js combining, and test your forum. Let us know.
SBlueman
05-02-2011, 01:21 AM
Yes, those are the options I was referring to. It seems that the issue is resolved once I disable .js combining. However, what to do if you want to combine .js?
Marvin Hlavac
05-02-2011, 08:16 AM
You can (should?) specify in Combine It options that you want to combine only files from the same host.
Let is know if that helps.
SBlueman
05-05-2011, 11:49 PM
I gave your suggestion a shot but unfortunately the issue remains with those settings in place.
Marvin Hlavac
05-06-2011, 11:48 AM
The next step would be to determine which .js file causes the issue. One by one, place the names of the .js files, which load when you access your thread pages, to the list of Combine It stop words, till the issue goes away. My guess is that the .js file is related to some add-on you have. Let us know.
SBlueman
05-15-2011, 12:57 AM
How can I find the names of the .js files to test?
Marvin Hlavac
05-15-2011, 08:52 AM
One way to find out which .js files load when a page opens is to 1. Open the page in a web browser, 2. View the source code by clicking View > Source on the menu bar of your web browser, and 3. Search (Ctrl+F) the source page for instances of .js
muratcan25
05-15-2011, 04:05 PM
Thank you
A.Chakery
05-30-2011, 03:33 PM
when I enable this plugin, my website doesnt load, any help is appreciated.
Regards...
A.Chakery
05-30-2011, 04:27 PM
Now I get this :
Fatal error: Uncaught exception 'JSMinException' with message 'Unterminated string literal.' in /home/user/public_html/includes/php-min.php:94 Stack trace: #0 /home/user/public_html/includes/php-min.php(235): JSMin->action(1) #1 /home/user/public_html/includes/php-min.php(64): JSMin->min() #2 /home/user/public_html/includes/combineit.php(177): JSMin::minify('<!DOCTYPE html ...') #3 /home/user/public_html/includes/functions.php(5737) : eval()'d code(9): combineJS('<!DOCTYPE html ...') #4 /home/user/public_html/includes/functions.php(5737): eval() #5 /home/user/public_html/index.php(599) : eval()'d code(303): print_output('<!DOCTYPE html ...') #6 /home/user/public_html/index.php(599): eval() #7 /home/user/public_html/vbseo.php(1397): require('/home/user/...') #8 {main} thrown in /home/user/public_html/includes/php-min.php on line 94
Marvin Hlavac
05-30-2011, 04:40 PM
Ali, try to disable the combining of .js (combine just .css). See if that works. If yes, then the next step will be to find out which .js file is causing problems. Likely it will be one of an add-on, or something that doesn't originate from vBulleting itself. You will be able to place such file(s) on the "do not combine" list.
A.Chakery
05-30-2011, 07:24 PM
oh, thanks for the tip marvin, I am gonna go for it.
regards.
Cyrez
07-04-2011, 02:47 PM
We need this for vb4.. Anything extra we can use to optimize.. we need!
final kaoss
07-20-2011, 03:00 PM
Agreed. Bumps
lolly01
08-17-2011, 12:39 AM
vb4 compatible?
Kolbi
10-19-2011, 09:33 AM
*push*
vB 4?
vbulletin 4 ????? Update coming up or /?? ?
thecore762
01-03-2012, 06:33 AM
Bump, I'd like to see a similar addon for vb4.
Rolgabu
04-12-2012, 08:29 PM
i've made a v4x version of this addon.
gonna upload it at some point.
added cdn integration feature (rewrites urls inside css)
Rolgabu
04-12-2012, 08:58 PM
well. ive used the idea from his script, but the code is written from scratch.
dont think i need a premission to post script written by me.
or if so, i'll ask him.
i dont think thats gonna be a problem.
Deafmute
08-03-2012, 10:45 AM
tanx dude
ChiNa
08-11-2012, 02:34 AM
I am sorry to say, but this is one if the most disapointing mods I have seen on here! First thing when I ran this, just running my CMP_INDEX.PHP page, I got 500 bytes of JS CACHE! and the page was running 100 times slower! I used it for 2 hours, checking and checking! Never ever seen a mod with so less power, and so much damage!
But the Idea is totally great, I am just disapointed that it does not work for me!
Keep up the good job!
final kaoss
04-19-2018, 07:23 PM
does not work properly unfortunately.
This would be great to have for vbulletin 4, so I'm putting in a mod request (unpaid) (https://vborg.vbsupport.ru/showthread.php?t=324706). Unfortunately, this mod author hasn't logged in since 2013.
One glaring problem is that it seems to create multiple css files (perhaps one per unique visitor?) in the cache folder. This should be changed to have only one css per template/style to rule them all instead of winding up with thousands of css files. Plus it also seemed to mess up with some css, disfiguring the appearance.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.