PhpRiot
Follow phpriot on Twitter
Sponsored Link
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store
Free iPad/iPhone App
Available on the App Store

  • PHP manual
  • Zend Framework manual
  • Smarty manual
  • PHP articles
  • PHP training

Zend_Cache_Frontend_Output

Introduction

Zend_Cache_Frontend_Output is an output-capturing frontend. It utilizes output buffering in PHP to capture everything between its start() and end() methods.

Available Options

This frontend doesn't have any specific options other than those of Zend_Cache_Core.

Examples

An example is given in the manual at the very beginning. Here it is with minor changes:

<?php
// if it is a cache miss, output buffering is triggered
if (!($cache->start('mypage'))) {

    
// output everything as usual
    
echo 'Hello world! ';
    echo 
'This is cached ('.time().') ';

    
$cache->end(); // output buffering ends

}

echo 
'This is never cached ('.time().').';

Using this form it is fairly easy to set up output caching in your already working project with little or no code refactoring.

Zend Framework