Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] What happens when the resource timing entries buffer is full? #230

Closed
Nithanaroy opened this issue Aug 27, 2020 · 3 comments
Closed

Comments

@Nithanaroy
Copy link

Nithanaroy commented Aug 27, 2020

Is there a recommendation for browsers on how to clear the resource timing entries buffer when it is full? On Chrome and Safari (latest), I see they just drop the new entries when it is full. Wouldn't a circular buffer be more useful?

@npm1
Copy link
Contributor

npm1 commented Aug 27, 2020

You can call clearResourceTimings() and/or setResourceTimingBufferSize(). Having a circular buffer would still make you lose the earlier entries unless you already read them.

@Nithanaroy
Copy link
Author

Yeah, thank you.
But does the spec define anything about dealing with situation when buffer is full? Is it safe to assume that all major browsers (tracked by caniuse for example), throw away events once the buffer is full like Chrome and Safari (latest)?

@yoavweiss
Copy link
Contributor

The spec define that entries that exceed the buffer, broadly speaking:

  • Get added to a secondary buffer
  • Fire the resourcetimingbufferfull event
  • If the handler increased the buffer size, the secondary buffers gets copied over

The full processing model is defined here

Closing, but feel free to reopen if that doesn't answer your question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants