Directory

← Back

Unload Beacon for Vaadin Flow

Sends a beacon on unloading a page to close UIs without delay.

Author

Rating

Popularity

100+

Unload Beacon for Vaadin Flow

Starting with Vaadin 24.1 this add-on is obsolete!

This add-on uses the Beacon API to signal whenever a page is unloaded in the browser in order to immediately close the UI on the server. This allows for much earlier clean up of UIs and associated resources than having to wait for missed heart beats or session timeouts to trigger a UI's eventual disposal. Of course this is only on a best effort basis as there will always be situations where the browser is simply "gone" and no beacon will or can be sent.

This add-on in based on a technique demonstrated in the Vaadin Cookbook.

Getting started

In a Spring Boot application this add-on will work automatically once it has been added as dependency. For other frameworks see VaadinServiceInitListener on how to register the UnloadBeaconServiceInitListener manually.

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • Supports and requires Vaadin 24.
Released
2023-03-09
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 24+
Vaadin 14+ in 1.0.1
Browser
Browser Independent

Unload Beacon for Vaadin Flow - Vaadin Add-on Directory

Sends a beacon on unloading a page to close UIs without delay. Unload Beacon for Vaadin Flow - Vaadin Add-on Directory
# Unload Beacon for Vaadin Flow > Starting with [Vaadin 24.1](https://vaadin.com/blog/vaadin-flow-24.1-drastically-reduces-memory-usage) this add-on is obsolete! This add-on uses the [Beacon API](https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API) to signal whenever a page is [unloaded](https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event) in the browser in order to immediately close the UI on the server. This allows for much earlier clean up of UIs and associated resources than having to wait for missed heart beats or session timeouts to trigger a UI's eventual disposal. Of course this is only on a best effort basis as there will always be situations where the browser is simply "gone" and no beacon will or can be sent. This add-on in based on a technique demonstrated in the [Vaadin Cookbook](https://cookbook.vaadin.com/notice-closed). ## Getting started In a Spring Boot application this add-on will work automatically once it has been added as dependency. For other frameworks see [VaadinServiceInitListener](https://vaadin.com/docs/current/flow/advanced/tutorial-service-init-listener.html) on how to register the `UnloadBeaconServiceInitListener` manually.
Online