PHP Classes

What is the best PHP cache whole page class?: Cache the whole Web page

Recommend this page to a friend!
  All requests RSS feed  >  What is the best PHP cache whole page...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

What is the best PHP cache whole page class?

Edit

Picture of Mpho Moipolai by Mpho Moipolai - 8 years ago (2016-09-07)

Cache the whole Web page

This request is clear and relevant.
This request is not clear or is not relevant.

+3

I want to cache whole Web pages with a cache script thats not complicated.

Ask clarification

2 Recommendations

AhCache: Store cached data in files

This class can store cached data in files.

It can check if a given cache file exists and it has not passed more than a given expiry time. The class checks the last modified timestamp to determine if the cache file is expired.

In that case the class can retrieve the cached data. Otherwise the class can store the cache data in a file for a given expiry period.

The cache directory is derived from the cache ID value. The class can create sub-directories to reduce the number of cache files per directory.

The class can also delete individual cache files, all cached files about a given age of one or all modules.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Axel Hahn by Axel Hahn package author package author Reputation 35 - 8 years ago (2016-09-11) Comment

The ahcache class stores all items that can be serialized (integer, string, arrays, ...). Its main usage is to store a cache for a functionality that was identified as a slow component (with long running queries, fetching external content like rss feed from other websites). To identify outdated content you can use a TTL, or read the age or compare with a file. Cleaning up the cache directory is included too.

Using a php class for caching means: you need to touch the source code. If you don't want to touch any code and have the possibility then use caching modules like mod_cache in apache/ proxy_cache in nginx or a separate caching host, i.e. varnish.


AC full page cache: Capture and cache the output of whole page scripts

This class can capture and cache the output of whole page scripts.

It can check if the current page script cache file exists and is up to date. If it is, it outputs the contents of the cache file.

Otherwise it starts capturing the script output and registers a PHP shutdown function that will retrieve the captured output and stores it in the cache file when the script exits.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Manuel Lemos by Manuel Lemos Reputation 26695 - 8 years ago (2016-09-08) Comment

You may want to try this class. It can start capturing the page output in the beginning and output it using a registered shutdown function, so you do not need to change much your scripts to cache your pages output.


Recommend package
: 
: