Performance: Default API endpoints
Default API endpoints affect the initial page load speed and server response time by handling data requests efficiently.
fetch('/wp-json/wp/v2/posts').then(res => res.json()).then(data => console.log(data));fetch('/wp-json/custom/v1/posts').then(res => res.json()).then(data => console.log(data));| Pattern | Server Processing | Network Transfer | Client Parsing | Verdict |
|---|---|---|---|---|
| Custom API Endpoint | High (complex queries) | Medium (JSON size varies) | Medium | [X] Bad |
| Default API Endpoint | Low (optimized core) | Low (standard JSON size) | Low | [OK] Good |
/wp-json/wp/v2/.posts, so full URL is /wp-json/wp/v2/posts./wp-json/wp/v2/posts/10 in a WordPress site?/wp-json/wp/v2/posts/{id} fetches a single post by its ID./wp-json/wp/v2/users but get a 401 Unauthorized error. What is the likely cause?categories for category IDs and status for post status.status=publish.Pass the test and this pattern moves unknown