files/en-us/web/api/deferredrequestinit/index.md
{{DefaultAPISidebar("Fetch API")}}{{SeeCompatTable}}
The DeferredRequestInit dictionary of the Fetch API represents the set of options that can be used to configure a deferred fetch request.
The DeferredRequestInit object is passed directly into the {{domxref("window.fetchLater()")}} function call as the second argument.
This dictionary extends the {{domxref("RequestInit")}} dictionary with the addition of the following properties:
activateAfter {{optional_inline}}
activateAfter property is not provided, the deferred fetch waits until the end of the page visit (including entering the bfcache).RangeError {{domxref("DOMException")}}
activateAfter is provided.GET request until the page is destroyed or enters the bfcacheIn this example, no DeferredRequestInit object is provided and no timeout is used:
fetchLater("/send_beacon");
POST request for around 1 minuteIn this example we create a {{domxref("Request")}}, and provide an activateAfter value to delay sending the request for 60,000 milliseconds (or one minute):
fetchLater("/send_beacon", {
method: "POST",
body: getBeaconData(),
activateAfter: 60000, // 1 minute
});
[!NOTE] The actual sending time is unknown, as the browser may wait for a longer or shorter period of time, for example to optimize batching of deferred fetches.
{{Specifications}}
{{Compat}}