Autorefreshable table

I have table as part of the view that I need to autorefresh every N seconds in order to display new data. Not all updates are populated via Vaadin system so I need to use polling from my view component. When user open View polling is started and table is being refreshed. The problem is when polling should stop. In case user navigates to another view, there is detach event fired and I can stop polling, however when user closes the browser, no event occured and polling continues…What is the best practices to solve it?

Thanks

Does your session still exist after three missed heartbeats? See
https://vaadin.com/docs/v8/framework/application/application-lifecycle.html

-Olli