- Not sure what you mean by caching a module. You don't cache a module, you cache a module's data - which can be anything from text, to json, html, objects, etc.
Usually, blocks & collection data should be cached, but you can cache anything else using Mage::app()->saveCache()
and Mage::app()->loadCache()
. Check the methods for the required parameters.
Blocks can be easily cached by extending Mage_Core_Block_Abstract
and implementing the getCacheKeyInfo
method - check the abstract class for more caching options.
Same for collections, see Mage_Core_Model_Mysql4_Collection_Abstract
for more details - look for _canUseCache()
Not sure what you mean by this. Magento uses various cache tags, but you're not bound to those, you can add any tag you like. Also, cache backends vary from files to memcached and redis, it's up to you which one you use.
Pro's and con's for using caching? You should always cache operations that might take a long time to process, mostly those that are executed often and produce the same result. This is not really a magento question, it's more about application architecture, performance optimization and the desire to create a solid extension. try searching for "when should i cache data" on google.
Ultimately, look at the magento core code and see when they cache things and try to figure out why.