A cache is a collection of duplicate data, where the original data is expensive to fetch or compute (usually in terms of access time) relative to the cache. In PHP, caching is used to minimize page generation time. PHP basically has two main types of caching: ‘output caching’ and ‘parser caching’. PHP ‘output caching’ saves a chunk of data somewhere that can later be read by another script faster than it can generate it. ‘Parser caching’ is a specific feature. PHP is a scripting language and code is not compiled or optimized to a particular computer. Every PHP file must be parsed and that takes time. This type of time minimization is ‘parser caching’.
The simplest way to implement caching in php, just update your .htaccess file. Here is my current .htaccess caching:
After updating the .htaccess file, dont forget to restart your httpd/apache server.