in reply to Invert a hash... not a FAQ (I hope)

I also recommend using a database.

I've done something similar myself. In my case, I have a cron job run once per hour, fetching new data from the source, and loading it into the database (any pre-processing that needs to be done can be handled at this point).

For a while, I had cgi scripts generate reports on demand. But now I've started caching the "report pages". A cgi script runs, and if the report exists, it slurps it in and dumps it to the browser. If it does NOT exist, it creates it (so it will be there next time), then dumps it to the browser. This helps reduce the number of database hits when lots of people are looking at the same report.

Note that the output doesn't have to be html - I could also generte reports as PDF files, etc.

  • Comment on Re: Invert a hash... not a FAQ (I hope)