Question: I am trying to make some cache system for my php engine, so I need to save html source of just rendered php file. 
I know that I could create some $htmlsource var and render all page to it, but there is a lot of work to change for that.
I would like to get just rendered html from some buffer or whatever, can you help me?

Answer: 
You need to use output buffering. 

```
ob_start();
//here is php code prints some content
$content = ob_get_content();

```
You're heading in the wrong direction. The best approach is to use a mixture of different caching technologies.

* There are [PHP accelerators](http://en.wikipedia.org/wiki/List_of_PHP_accelerators).
* There are easy-to-use key-value store daemons such as [Memcached](http://memcached.org/) and [Redis](http://redis.io/) (cache the results of expensive database queries).
* There are options available for [client-side caching](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html).