cache is string and toString to improve performance
(cherry picked from commit 8c7fcb7781c89cc2d41c415ff5fbb755bbd4000c)