[M]Cache support for lib_template