
MySmarty is a small wrapper class for the free, Open Source PHP Smarty project which allows different 'areas' in a template to be cached using different caching properties.
By default the cache properties; cache id, lifetime etc. are setup and then a template is parsed. Therefore the only way to cache different bits of a page separately is to split it into lot's of separate templates and then join them all together before output.
This wrapper does that automatically by defining a new block level tag which will mark a section of the template which should be compiled and cached separately to the main template. It will also allow cached areas to report their last modification time allowing Smarty to still return a '304 - Not Modified' HTTP status code when configured to do so.
The code overrides some key Smarty class methods and has been tested for Smarty version 2.6.19. As it relies on underlying Smarty features it may or may not work on other versions.
For full details refer to the MySmarty project source code on my GitHub account.