For minimum modification you would change your SSI from
<!--#exec cgi="/cgi-bin/foo.cgi"-->
to
<!--#include virtual="/cache/latest.html" -->
You would add a command to your crontab like:
30 * * * * /www/cgi-bin/foo.cgi > /www/cache/latest.html
All this entry does is run the foo.cgi script once every 30 minutes and pipe the output to the file you are including via your SSI. Naturally you will need to adjust the paths and names to suit. Execute the command once to generate the latest.html include and also ensure that the command works as expected.