Added type information caching for encoder