fetchsendbeacon

Does fetch API allow Post request to run in background even when user moves to a different url?


Beacon Post messages would run in background and can even send data when user moves on to a new page. Does Fetch have similar functionality? Someone said it runs in a separate background process, but I couldn't find any documentation that validates this.


Solution

  • Looks like Fetch is no different than XHR. It just performs better due to browser's implementation of it. There is no specification which says Fetch will perform better than XHR for POST on Unload event.