Current version: 0.5 (2006-10-08)
HttpCaching is a very simple PHP
class to make specifying HTTP caching headers (Cache-Control, Expires, ETag and Last-Modified) easier,
and only processing the request if it is needed (otherwise, return a
304 Not Modified).
A simple example is available to show how to use it.
| No caching information | With freshFor("1 hour") from HttpCaching |
|---|---|
HTTP/1.1 200 OK Date: Sat, 26 Aug 2006 11:00:07 GMT Server: Apache/1.3.33 (Unix) X-Powered-By: PHP/5.1.2 Content-Type: text/html |
HTTP/1.1 200 OK Date: Sat, 26 Aug 2006 11:00:07 GMT Server: Apache/1.3.33 (Unix) X-Powered-By: PHP/5.1.2 Expires: Sat, 26 Aug 2006 12:00:07 GMT Cache-Control: max-age=3600 Last-Modified: Sat, 26 Aug 2006 11:00:07 GMT Content-Type: text/html |
It's composed of one small PHP file: HttpCaching.
Documentation of the HttpCaching class is available.
I encourage you to read Mark Nottingham's caching tutorial.