|All requests||>||What is the best PHP cache whole page...||>||Request new recommendation||>||Featured requests||>||No recommendations|
by Mpho Moipolai - 7 years ago (2016-09-07)
I want to cache whole Web pages with a cache script thats not complicated.
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.
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.