Automattic / Automattic/jetpack
VideoPress: Research "hitting local endpoints" approach
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
There are [two](https://github.com/Automattic/jetpack/blob/0df71073e6d183464cf604acd85b7a23fae65fda/projects/packages/videopress/src/class-data.php#L61) [places](https://github.com/Automattic/jetpack/blob/7d39d5cd49c5f30b003ad80c67f8b2e1b70891ea/projects/packages/videopress/src/class-data.php#L112) where the app performs a request from the backend to an internal endpoint.
It's worth researching this approach in terms of performance, considering it's possible to replace it using internal core functions like [get_posts()](https://developer.wordpress.org/reference/functions/get_posts/), [get_users()](https://developer.wordpress.org/reference/functions/get_users/), etc.
## Why hitting internal endpoints
Because we'd like to keep the consistency between the initial state ([provided by the backend](https://github.com/Automattic/jetpack/blob/7d39d5cd49c5f30b003ad80c67f8b2e1b70891ea/projects/packages/videopress/src/class-data.php#L285-L316) in the initial rendering) and the subsequence async requests performed by the client to the same endpoint.
Contributor guide
Assessment
This issue has not been assessed yet.