Title: JSON API stripped headers
Last modified: October 3, 2019

---

# JSON API stripped headers

 *  Resolved [diplatis](https://wordpress.org/support/users/diplatis/)
 * (@diplatis)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/)
 * Hi,
    I noticed when I get a cached response from the JSON API the response headers:
   X-WP-Total X-WP-TotalPages documented at [https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/](https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/)
   are not being returned. How can I return them in every response? Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/#post-11998365)
 * Hello [@diplatis](https://wordpress.org/support/users/diplatis/)
 * I am sorry about the issue you are having with the response headers and I am 
   happy to assist you with this.
    You should use the caching method other than 
   Disk-Enhanced or modify the Cache_File_Generic.php file. In wp-content/plugins/
   w3-total-cache Cache_File_Generic.php, line 98 `if ( isset($h['n']) && isset(
   $h['v']) && $h['n'] == 'Link' ) {`
 * Controls if it tries to cache header.
    This should be changed to
 * `if ( isset($h['n']) && isset($h['v']) && ( $h['n'] == 'Link' || $h['n'] == '
   W-WP-Total' || $h['n'] == 'W-WP-TotalPages' ) ) {`
    for those headers.
 * I hope this helps!
 *  Thread Starter [diplatis](https://wordpress.org/support/users/diplatis/)
 * (@diplatis)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/#post-12000275)
 * Hi [@vmarko](https://wordpress.org/support/users/vmarko/)
    I modified the above
   mentioned file as instructed but no change.
 *  Thread Starter [diplatis](https://wordpress.org/support/users/diplatis/)
 * (@diplatis)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/#post-12007841)
 * [@vmarko](https://wordpress.org/support/users/vmarko/) any help, please?
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/#post-12007937)
 * Hello [@diplatis](https://wordpress.org/support/users/diplatis/)
    Sorry for the
   late reply, we were testing this. We need to inspect this deeper and as you are
   a Pro user you can drop us a note via the plugin in Performance>Support. Thanks!
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/#post-12050211)
 * No activity from the user.
    Marking topic as resolved.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘JSON API stripped headers’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [headers](https://wordpress.org/support/topic-tag/headers/)
 * [json](https://wordpress.org/support/topic-tag/json/)

 * 5 replies
 * 2 participants
 * Last reply from: [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/json-api-stripped-headers/#post-12050211)
 * Status: resolved