Currently io.fits/pyfits always loads all extension headers regardless whether one wants them all or not.
At least the obvious api function getheader has this behaviour.
This slows down simple tasks like just checking the primary extension headers keys considerably when the number of extensions is large as it needs to seek through the full file.
Obviously seeking the file is required to load the later extensions but it should only try to read as much as it must to satisfy the users request.