cache + mysql integration on template