I've long toyed with the idea of some kind of auto-cleanup page that performs routine maintenence tasks and is called out of scope of the current page execution by means of calling a 1x1 pixel gif with the asp.net page as the src parameter. One thing I've never really decided on, however, is how to handle the timing of such a page's execution so that it doesn't execute with every request, maybe like.. every 5th request. or every 30 minutes or some other interval.
How would you consider building such a mechanism?