#6288: add cache to getStructureCode()