combine the nearly identical caching code for the multiple string and id functions into a multi-item decorator