I have a new client for whom I'm adding a feature to their shopping cart. I don't think their previous developer quite finished the site; there was an obvious bug that generated an error when one tried to remove something from the cart.
But the surprise was that the database contains 644,000 sessions! That's 150MB. Also 18,000 shopping carts, all generated in a little over a year, that's maybe 1600 sessions and 50 carts a day, pretty low volume (they sell expensive stuff). It would be advisable to set up a cron job to remove old sessions and carts, yes? But I had another idea. On another low volume site I created, some pages displayed tables that could also be downloaded as csv's. The csv's are generated at the same time as the displayed table, it was just easier that way. After generation they're saved to the database, available for download. Rather than add a cron job to remove old csv's, when a table and new csv are generated, the controller searches for csv's older than a couple days and deletes them. Any problem with doing the same thing on the site with the shopping cart? I don't think I would add the check to every new session. Maybe when creating a new cart it could remove old sessions and carts; if that caused a small delay it would be tolerable, the user is more likely to be patient when waiting for the cart to first come up. Comments? Thanks, Scott -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
