Hrm, how unfortunate that the "first gid" is stored inside the TileSet class. In Tiled Qt, I've kept it out of there since it's only needed while reading/writing maps. If it would be factored out of that class, the cache would not need to deal with that attribute.