Updating Template Cache Logic