Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7711371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:21:31+00:00 2026-06-01T01:21:31+00:00

I use object buffering to buffer the output of my php pages using ob_start(‘ob_gzhandler’);

  • 0

I use object buffering to buffer the output of my php pages using ob_start('ob_gzhandler');.
Does this affect the performance of the files stored in CDN?

The reason for asking this question is because, one of the site indicated the following about “Output buffering is a simple way to greatly improve the performance and speed of your PHP script. Without output buffering, your script will show the HTML on the page as it’s processed – in pieces. Adding output buffering allows the PHP to store the HTML as a variable and send it to the browser in one chunk.”

Could you please clarify?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:21:33+00:00Added an answer on June 1, 2026 at 1:21 am

    Using ob_start certainly will affect the load times of your pages — not “the performance of your PHP script”, which is IMHO a totally misleading expression. But let’s take things from the beginning.

    User-perceived load time

    The side you mention seems to refer to page load time as perceived by the user. That is, assume that you have 10KB of HTML to send and you send 1KB every 50ms. Also assume that the browser is not putting any of its own logic in the process and it simply renders as fast as it can read the incoming data (which is certainly not true!). 50ms is long enough to be perceived by a human, so the user will see the page loading piece by piece.

    On the other hand, assume that all 10KB of HTML is sent in one go after 500ms. While this will result in the user waiting for the same total amount of time, the page will render in one fell swoop and this will be perceived by the user as being faster because “it spent less time being loaded”.

    I should also mention that if you take the exact same example and increase the load time to 5 sec (or 10 pieces of .5 sec) then the user perception will be reversed: now the second page is slower because “it took so long to get going”.

    Clearly this kind of analysis ventures well into the realm of psychology so I ‘m going to stop here and suggest that if you are interested in this stuff there is good material available on the web. This is the reason that browsers do put in their own special sauce in the process of rendering the page as data is received: each vendor wants to make their browser feel faster, even though as far as the network is concerned they are all equally fast.

    Output buffering

    Let’s also consider the server side. Anything on the web server stack — Apache, PHP, anything in between — can also choose to buffer up data before sending it. Oftentimes this happens even without being explicitly documented or requested by the developer, which is the reason that you will see code that should have presented “headers already sent” notices not do so.

    Now if you do buffer things on the server side, what you are really doing is forcing the browser to adapt to your idea of how things should work. Let’s go back to the client-side rendering example and consider a browser that receives HTML in small chunks but chooses to delay rendering in order to appear snappier. Doing so does not mean the browser has to do nothing during the delay; indeed, it will most probably parse the HTML and start loading dependencies (stylesheets, images, etc) immediately, even though it does not intend to render the page just yet. This is logical: by being up-front it will end up having the content of these assets available earlier and win the “perceived speed” war.

    The problem is, if you assume military command of buffering the browser can no longer do that. It has to wait for the content to be sent and then start looking for these assets. Since we ‘re talking about a CDN, fetching the assets will be very fast if not instantaneous (due to caching) but that’s still a small to zero delay you did not have to suffer.

    Of course then we have to take into account that output buffering with the intent of compressing can make the page actually load faster because there’s just less data to be sent. The difference will be especially noticeable to people with slow connections.

    TL;DR version

    If you have measured that compression makes a big difference in how fast your pages load, then use it. If you are not compressing, don’t try to second-guess browser vendors (who have spent uncountable resources on studies) on the advice of sites with unknown credentials.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Situation I'm generating wrappers by using the ILGenerator. I use Object.Equals(Object, Object) For the
I wrote this simple class that provides buffering for general output operation: template <typename
What is the difference in using object.variable and object->variable ? When should I use
Should we use object or variant ? What difference does it make?
If I use object initializers in using-block I get Code Analysis warning about not
Why I can use Object Initializers in Visual Studio 2008 Windows projects, etc targeted
I tried to use object expression to extend the IDelegateEvent, but in fsi there
I'd like to use object database to persist some classes created in IronPython. The
Can I make C# start Outlook in the code? In VB6 we use object
I use PopUpButton object and inside a Menu object. For some reason it has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.