Reduce the number of resources loaded by GetDoc

Fixes #4747.