PDA

View Full Version : Forum Display Enhancements - Faster Board view


mahakala
01-17-2009, 10:00 PM
Add a new Plugin with the following parameters to display the most pages much faster (NEEDS SEO or vbSEO or code changes*):

Product: vBulletin
Hook: parse_templates
Title: Flusher
PHP-Code:

if (headers_sent()) {
ob_start();
ob_implicit_flush(1);
flush();
ob_flush();
}
else if (preg_match("/ebdl|image|do=|dateline/i",$_ENV['REQUEST_URI']) || isset($_ENV['QUERY_STRING']) || isset($_POST)) { }
else {
ob_start();
ob_implicit_flush(1);
flush();
ob_flush();
}
That's all. Hope you could need it.

*The main problem with this hack is, that all headers must be send or errors occure (headers already send...). I use vbSEO, so i could figure out (querystring) when there are probably header changes. For nonSEO try the headers_send()-version and see, what happens.
Maybe someone has a better solution ;)

Regards,
Thomas

sensimilla
01-18-2009, 08:51 PM
Sounds cool, Ill wait until someone test it :)

mahakala
01-18-2009, 09:08 PM
it's plugin - you could deactivate it with one click if it don't work. just try it.

ssslippy
01-18-2009, 10:14 PM
What exactly does this do?

mahakala
01-18-2009, 10:34 PM
it faster flushes out the content, so page is faster displayed. see php.net/flush

Arved Yagami
01-19-2009, 04:48 AM
I have vbSEO, I'll give a try.

Thanks for the plugin.

Arved Yagami
01-19-2009, 04:54 AM
Ok, this really improved speed in my board. O_o
Thanks a lot, waiting for more of your mods =)

I'm not a coder, so how does exactly this work?

BTW. I'm using vB 3.8.0

mahakala
01-19-2009, 06:13 AM
Ok, this really improved speed in my board. O_o

nice to read :):cool::D

I'm not a coder, so how does exactly this work?

easyly said: normaly the board parses internaly (serverside) the code and then put it out to the browser. this little hack now tells the board to put out (flush) the code while still calculating. (sorry my bad english)

Leo Brazil
01-19-2009, 08:54 AM
I'm gonna try it, let's see how it goes.

Edit: Tested and it really makes page views faster.

sensimilla
01-20-2009, 11:10 AM
Seem its really working. Anyway it does no harm :) Thanks . Installed.

Ziki
01-20-2009, 11:23 AM
To explain this easier,usually when you load a website,the server waits till the whole website is loaded and then it displays it to the user,but using flush (); , it will be displayed part by part so it appears faster.

Leo Brazil
01-20-2009, 12:58 PM
Hi Ziki, it makes sense but why he says this is specially for SEO users ?

My question may sound stupid but just trying to get the connection between flush() and SEO.

Tks

mahakala
01-20-2009, 03:57 PM
Hi Ziki, it makes sense but why he says this is specially for SEO users ?

My question may sound stupid but just trying to get the connection between flush() and SEO.

Tks

i haven't tested it in a non-seo vb - thats all ;) i changed the code above, should work now on all versions.