Jump to content

output buffer


sonill

Recommended Posts

Its covered thoroughly within the manual.

 

why is output buffer used

 

It has allot of different uses, most notably probably in template engine development.

 

and does it help in speeding the code processing speed and web page loading.

 

Generally, no. It would have the opposite effect.

Link to comment
https://forums.phpfreaks.com/topic/164814-output-buffer/#findComment-869085
Share on other sites

Very rarely do people use it for the right reasons. Most of the time people use it to mask bad programming logic, when they are getting header errors from outputting data to the browser before setting a header or a cookie.

 

One good use of output_buffer is to cache static pages to speed up loading times. You put everything in the output buffer, then create an HTML file with the contents. Then each time the page is loaded, you check to see if anything new has been added to the page since the last html page was created. If nothing new has been added, you output the html page, if it has, you create a new html page, and output that.

 

It adds a slight bit of processing time to the first person to access a page after the data has been changed, but speeds up all subsequent load times until the next time something new is added to the page.

Link to comment
https://forums.phpfreaks.com/topic/164814-output-buffer/#findComment-869138
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.