---
title: "Comment by A.Rehman on \"Custom REST API Integration for WordPress: Endpoints, Auth and Caching Done Right\" | Hashnode"
description: "The caching headers part is where i usually lose time in production. you can set Cache-Control right in the callback, but half the time the host's layer just ig"
url: "https://hashnode.com/posts/custom-rest-api-integration-for-wordpress-endpoints-auth-and-caching-done-right/6afa07d566ea1c58757afbee/comment/6b05455d3e8b9c18e1e6f8a8"
---

[Discussion](https://hashnode.com/posts/custom-rest-api-integration-for-wordpress-endpoints-auth-and-caching-done-right/6afa07d566ea1c58757afbee)

Comment [Custom REST API Integration for WordPress: Endpoints, Auth and Caching Done Right](https://hashnode.com/posts/custom-rest-api-integration-for-wordpress-endpoints-auth-and-caching-done-right/6afa07d566ea1c58757afbee)

[A.Rehman](https://hashnode.com/@iarehman)

[1d ago](https://hashnode.com/posts/custom-rest-api-integration-for-wordpress-endpoints-auth-and-caching-done-right/6afa07d566ea1c58757afbee/comment/6b05455d3e8b9c18e1e6f8a8)

The caching headers part is where i usually lose time in production. you can set Cache-Control right in the callback, but half the time the host's layer just ignores it. on my cloudways setups, varnish bypasses /wp-json/ by default, and i've seen similar quirks on kinsta where php still ends up taking the hit unless you override it at the cloudflare level.

Also had a few cases where the server config just silently strips the Authorization header before wp even sees the application password, which is a pain to track down if you aren't expecting it.

when you're setting up high-traffic read endpoints for clients, do you usually just handle the edge caching through cloudflare rules, or do you actually mess with the server's varnish or nginx configs directly?
