DEV Community

Discussion on: Smarter list sorting with DataDrivenJS

Collapse
 
anndd profile image
Anna Su**

Thanks Josh! The events are stored in a small, session-persistent buffer and sent in short intervals and/or when the buffer is full - both, time and size, are configurable. Of course, there's always a chance that if a user clicks an external link some events might never be sent, but that could also be the case if you'd set the buffer size to 0 to force an immediate request.

Sending events in packages, besides the benefits you mentioned, helps to avoid reaching the limit of parallel connections both, in a browser and in the backend. Considering how many different tracking services are installed on every website, managing resources is critical.

One of the hardest decisions building the lib was to drop support for promises, simply because the polyfill would significantly increase the size.