Store events in cache. Return all events if requested.