don't use iterator_to_array, doesn't seem to work correctly
cache contents encoded, avoids gzipencode call on every output