Closed pauldambra closed 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
posthog-js | ✅ Ready (Inspect) | Visit Preview | Sep 15, 2024 2:39pm |
Size Change: +516 B (+0.04%)
Total Size: 1.21 MB
Filename | Size | Change |
---|---|---|
dist/array.full.js |
346 kB | +129 B (+0.04%) |
dist/array.js |
162 kB | +129 B (+0.08%) |
dist/main.js |
163 kB | +129 B (+0.08%) |
dist/module.js |
162 kB | +129 B (+0.08%) |
we set keepalive to true for any request that is a POST
the fetch spec at https://fetch.spec.whatwg.org/#http-network-or-cache-fetch says
read more at e.g. https://javascript.info/fetch-api#:~:text=But%20the%20keepalive%20option%20tells,for%20keepalive%20requests%20is%2064KB.
it is likely that a replay payload would be >64kb compressed
not all browsers obey this spec equally (of course) so it won't always fail, so it's not broken consistently enough to stand out.
but locally I can see network requests failing for this reason
fetch keepalive is intended for situations including those like analytics (👋 posthog) where you might want to allow a request to finish even though the page is navigating so we don't want to turn it off completely
lets estimate body size and set keepalive when its safe (which it should be for most analytics events)