Use a palette cache in matreader.js