Skip to content

Allow filtering of syncing frequencies in polling client #76517

@peterwilsoncc

Description

@peterwilsoncc

What problem does this address?

The RTC polling client currently runs at these frequencies:

  • Once per second if no other collaborators are in the room
  • Four times per second if other collaborators are in the room
  • A couple of back off rules apply for the following circumstances:
    • An error occurs while syncing
    • The editor is not visible, ie the user is using another browser tab

As these rates generate a large number of requests, it may cause problems for users of low end hosting plans and result in them inadvertently DDOSing themselves.

See Discussion on WP#64845

What is your proposed solution?

Add filters to the polling intervals defined in this block of code to allow third party developers to slow the syncing rate as desired.

const POLLING_INTERVAL_IN_MS = 1000; // 1 second or 1000 milliseconds
const POLLING_INTERVAL_WITH_COLLABORATORS_IN_MS = 250; // 250 milliseconds
// Must be less than the server-side AWARENESS_TIMEOUT (30 s) to avoid
// false disconnects when the tab is in the background.
const POLLING_INTERVAL_BACKGROUND_TAB_IN_MS = 25 * 1000; // 25 seconds
const MAX_ERROR_BACKOFF_IN_MS = 30 * 1000; // 30 seconds

Metadata

Metadata

Assignees

Labels

No fields configured for Enhancement.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions