Initially a simple optimization task of an existing web application, the first result was to have separate models (and model files) for each fresh and cached version.
Not fully content with the result, Matthias Willerich mapped out his ideas, while Pascal implemented and wrote about it:
“[…] against my MVC preferences the main logic takes place in the controllers.
This meant 2 things for me:
- The solution needed to be able to take on existing models with minimum effort, and a strong convention
- I wanted to see in the controller if I was caching or not, and have an easy way of of toggling between the two in debugging.”
This quickly lead to the wish to have both $model->method() and $model->cache->method() available in the controller, without rewriting all models and methods, or most of the controller code.
Read about the solution with the whole code example over at Content with Style.


Comments (Login to leave comments)