30.07.2012 Views

Reference Guide

Reference Guide

Reference Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Zend Server <strong>Reference</strong> Manual<br />

Zend Page Cache<br />

The Zend Page Cache component is used to cache the entire output of PHP scripts, without changing the<br />

PHP code.<br />

The Zend Page Cache improves PHP application performance by caching the entire output of PHP<br />

scripts (HTML, XML, etc.), while still maintaining dynamic capabilities through an elaborate rules system.<br />

Rules are configured in the Administration Interface.<br />

Page caching extends the concept of caching files and applies it to pages. Caching by page facilitates the<br />

ability to eliminate situations where the same file is used in multiple instances, such as when the same file<br />

is used to redirect to several pages.<br />

When to Cache Pages<br />

Pages should be cached when their content is stable and does not require frequent changes. You can<br />

cache any PHP generated output including, HTML, XML, and images (if the images are generated by<br />

PHP, such as graphs and charts).<br />

Compression should be used to cache content such as HTML, XML and plain text, but is not<br />

recommended for caching binary output.<br />

When Not to Cache Pages<br />

Caching is not recommended for files that have constantly changing output, such as clocks, timers and<br />

database queries.<br />

Compression should not be used for images, PDF files, .exe files, ZIP files or any other compressed<br />

binary formats.<br />

Note:<br />

Zend Page Cache only caches GET and HEAD HTTP requests. To comply with the HTTP RFC, POST<br />

requests are never cached.<br />

All cached content is stored in a hashed directory structure on disk. The location is defined by the<br />

directive zend_pagecache.save_path.<br />

Caching Alternatives<br />

Web pages that contain sections that continuously change can also be cached. This partial page caching<br />

solution can be accomplished by applying the Data Cache API to the portions of code that do not change.<br />

Data caching is an intermediate solution to provide a partial performance boost that can sustain the<br />

accuracy of changing content.<br />

To find out more about this alternative, go to Data Cache<br />

196

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!