
I always wanted to create a simple cache script that should be easy to use, flexible and can take parts of webpage to store separately as cache files. Sometimes you do not need full page cache mechanism.
I was working with the admin of a website and client needed to save Google Analytic code into the database. So I created a panel where he could save JavaScript code into database table to retrieve it in footer of website on every page. And then I created a section to save meta code for head section of website in database. That worked fine but it was not saving JavaScript code into the database. HTML code can be saved in database easily without any error. If you want to save JavaScript or PHP code into database, then you need a work around for that.

PHP Simple cache is a very useful caching script that can be used on any PHP website to make it responsive. Cache whole website or individual pages. You can turn on cache for most common pages or most visited pages.
Sometimes clients need to edit their CSS to make design changes and you have to implement a mechanism in website admin to get CSS, edit it and save it. You can do it in several ways but here is popular one like WordPress use while theme editing. Here it is.
We have earlier given a cache script to cache PHP websites. Here is another ready to use open source solution. This package is a little cache system optimized for file containers. It is fast and safe (because it uses file locking and/or anti-corruption tests). Implementation is really easy.
PHP website cache system will reduce server load, make website more responsive and fast. It will reduce database requests and save time that sever takes to translate PHP pages before sending them to browser. This cache script converts PHP pages in static pages and stores them in cache folder. If static version of page exists in cache folder it will be served unless PHP page will be shown and its cache will be created to show next time visit. Here is simple cache script ready to use and implement in any PHP based dynamic website.
Here is how to use mySQLi, connect to the db and display a single record from database.

