Output Buffering
Without output buffering, PHP sends data to your web server as soon as it is ready - this might be line by line or code block by code block. Not only is this slow because of the need to send lots of little bits of data, but it also means you are restricted in the order you can send data. Output buffering cures these ills by enabling you to store up your output and send to send it when you are ready to - or to not send it at all, if you so decide.
Topics covered in this chapter are:
-
When to use output buffering
-
Manipulating multiple buffers
-
Incremental data flushing
-
Output compression
Chapter contents
- 13.1. Advantages
- 13.2. Performance Considerations
- 13.3. Getting started
- 13.4. Reusing buffers
- 13.5. Stacking buffers
- 13.6. Flushing stacked buffers
- 13.7. Reading buffers
- 13.8. Other OB functions
- 13.9. Flushing output
- 13.10. Compressing output
- 13.11. URL rewriting
- 13.12. Summary
- 13.13. Exercises
- 13.14. Further reading
- 13.15. Next chapter



Copyright 2012 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at
Beauford Court, 30 Monmouth Street, Bath, BA1 2BW, UK