In Ibzi’s blog, he has posted a new entry, which provides five steps to cache your pages in PHP. He says, caching your pages can be useful, if you have PHP-generated pages that uses a lot of MySQL queries. The benefit of caching in PHP is that once your pages are cached, your server won’t waste speed and RAM on regenerating the pages, it will load it from the cache, he says. He also shows you how to get PHP to cache your pages in a short span of time.
He talks about three basic requirements to carry out the process. First and foremost, he says that you need to have a PHP enabled web site. Secondly, you will need to know how to change permissions of a folder/directory on your host to 777. If you don’t know how to do this, try a Google search. Finally, you need to know the full path to your home directory, this is usually/home/your-username/public_html/, he instructs.
He states the five steps to cache your pages in PHP:
- On your home directory, you have to create the following files; .htaccess,
start_cache.php,end_cache.php, and create a folder named‘cache_files’. - Than, change the folder
‘cache_files’permissions to 777. - Inside your
.htaccessfile, place the following two lines:
You will need to change ‘/home/username/public_html/’ to your full home path.
- After that he places a long code into ‘start_cache.php’. Again, he says, you will need to change ‘/home/username/public_html/’ to your full home path.
- In the final step, he places, the following code into
‘end_cache.php’
He further informs you that all your pages including your static HTML pages will be cached for 3600 seconds, which can be changed on
start_cache.php. After this he says, the cached pages will be saved inside your ‘cache_files’ folder..




