Docs > Extensions > Plugins > Bufferoutput

BoltWire comes with a special built in plugin called BufferOutput you can use to run background processes like indexing or other pseudo cron jobs without slowing down page load times.

Basically, it creates the entire page, sends it to the browser, flushes the system, and then runs your background php jobs via the process function, after your site viewer has been released and is free to continue on browsing.

To be honest, I've only had mixed success with this working, and I much prefer to use actual cron jobs for those kinds of background jobs. The plugin doesn't seem to always fully release the browser. And second, it requires web traffic to trigger those background processes, which may not always be consistent.

Still, we've had it in the core for some time and I want to keep it available as a plugin in case you use it, so here it is.

To use it, enable the BufferOutput plugin by adding the following line to your site.config page, either for your entire site or for specific sections of your site. Since your only purpose for using this plugin is to manage background processes, you might as well make it available sitewide. You should see no effect with it turned on.


Now, to take advantage of this, you need to have another plugin that creates one or more "background" processes. This is pretty easy. Basically you create a plugin with the following lines:

$BOLTprocess['background'][] = Array('BackGroundStuff', $parameter);

function BackGroundStuff($parameter) {
     //misc lines...

You can add as many function/parameter pairs to the $BOLTprocess['background'] array as you wish, as long as you define each function. Providing a parameter is optional.