Added precaching to highlightDocument