Session Replay will not slow your page-load time, and its unavailability will not impact your page. Some techniques we use to ensure high performance include:
- First loading a small initial “container” script (9kb, gzipped), from AWS’s CDN (content distribution network) typically in less than 30ms, followed by an asynchronously loaded SDK.
- The session replay script is optimized to minimize any blocking of the main UI thread and avoid user-visible “hangs”.
- Post-processing user events in an in-memory buffer to minimize work done before handing control back to the browser’s event loop.
- Throttling the rate of processing events (uploads of compressed data every 15s).
- Minimizing data sent over the wire by compressing DOM HTML (~30-40%) and not sending any externally fetched images, CSS, fonts, etc. (these are captured separately via the Heap Replay Bot).
- Caching crawled assets (session level, customer level) to minimize additional requests.
To further optimize performance, check if your site uses CSP directives, and if so, enable worker-src: blob
(which improves UI performance by employing web workers).
For guidance that's more general, see Will Heap slow down my site?