Skip to content

RTC: Use SHORTINIT for polling provider endpoint #77065

@maxschmeling

Description

@maxschmeling

WordPress has a SHORTINIT constant that skips loading a lot of the WordPress core functionality.

Then if the SHORTINIT constant is defined, and set, it will stop the rest of WordPress being loaded. This is handy if you need to create custom requests which only need the core WordPress functionality, but not things like custom post types or custom taxonomies.

The endpoint would probably need to selectively load some parts of WordPress, but it would still be much more efficient.

Opus 4.6 on the possibility of using SHORTINIT for RTC sync endpoints:

Yes, it could work and would yield meaningful latency/memory savings, but it requires: (1) a new standalone PHP entry point, (2) replacing all WP_REST_* dependencies with manual request/response handling, (3) selectively loading the auth stack, and (4) rewriting storage to use only $wpdb instead of get_posts()/wp_insert_post(). The JS client change is small (point apiFetch at a new URL).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions