code: private void clearFacesEvents(FacesContext context) {
          if (context.getRenderResponse() || context.getResponseComplete()) {
              if (events != null) {
                  for (List<FacesEvent> eventList : events) {
                      if (eventList != null) {
                          eventList.clear();
                      }
                  }
                  events = null;
              }
          }
      }
docs: or if there is a response complete signal.