We investigate the influence of the degree of illumination coherence on through-focus scanning optical microscopy (TSOM) in terms of metrological sensitivity. The investigation reveals that the local periodicity of the target object is a key structural parameter to consider when determining the optimal degree of illumination coherence for improved metrological sensitivity. The optimal coherence conditions for the TSOM inspection of several target objects are analyzed through numerical simulation.