Add database cache for events and tasks