Reviving the Past: Enhancing Language Models with Historical Text Optimization