I have a plan that works.

If a file exists with the correct data, read that; otherwise, read from the web, and write the file.