We investigate the effect of dispersion compensation on temporal characteristics in mode-locking by nonlinear polarization rotation in an ytterbium-doped fiber (YDF) oscillator with intracavity and external grating pairs. A short fixed length YDF was spliced with a longer single-mode fiber (SMF). Using experimentally measured dispersion characteristics of the YDF, SMF and cavity optics, we control the group velocity dispersion (GVD) and spectral broadening in a cavity by changing the SMF length. As a result, the oscillator generated 29.4-fs transform-limited wing-free pulses, which are to our knowledge the shortest and cleanest pulses achieved without the use of additional optics like a prism pair for high-order dispersion compensation. The results show that a precise balance of higher order terms of the GVD and self-phase modulation is essential for shortening pulse duration.