Title: REST API Cache TTL
Last modified: January 2, 2020

---

# REST API Cache TTL

 *  Resolved Anonymous User 13711045
 * (@anonymized-13711045)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/)
 * Is it possible to specify the TTL for requests to the REST API? I want it to 
   differ from pages and posts.

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

 *  Plugin Support [Hai Zheng⚡](https://wordpress.org/support/users/hailite/)
 * (@hailite)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12286785)
 * Sure. Will give in v3.0
 *  Thread Starter Anonymous User 13711045
 * (@anonymized-13711045)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12287134)
 * Awesome thanks. I do have another question, I’m trying to cache the REST API 
   output of a custom endpoint but a nonce has to be provided to validate the request.
   I’m getting a 500 error when I do this and this shows in the server logs…
 * [Module:Cache] vary request header “Origin” not defined!
 * Any way to make this work?
    -  This reply was modified 6 years, 5 months ago by Anonymous User 13711045.
    -  This reply was modified 6 years, 5 months ago by Anonymous User 13711045.
    -  This reply was modified 6 years, 5 months ago by Anonymous User 13711045.
 *  [stanley@litespeed](https://wordpress.org/support/users/stanleylitespeed/)
 * (@stanleylitespeed)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12287260)
 * Hi @thekendog, can you show us the code of how you create the custom endpoint?
 *  Thread Starter Anonymous User 13711045
 * (@anonymized-13711045)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12308681)
 * [@stanleylitespeed](https://wordpress.org/support/users/stanleylitespeed/) it
   appears to be the same issue as here…
 * [https://github.com/litespeedtech/lscache_wp/issues/182](https://github.com/litespeedtech/lscache_wp/issues/182)
 * Any update on a fix for this?
 *  [stanley@litespeed](https://wordpress.org/support/users/stanleylitespeed/)
 * (@stanleylitespeed)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12312076)
 * Hi @thekendog, could you please [join our Slack channel and find me(Stanley Cheung at Litespeed)](https://litespeedtech.com/slack/)
   or [submit a ticket here](https://store.litespeedtech.com/store/submitticket.php)
   for helping us to reproduce the bug, thanks.
 *  Plugin Support [Hai Zheng⚡](https://wordpress.org/support/users/hailite/)
 * (@hailite)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12399009)
 * REST TTL is added in [https://github.com/litespeedtech/lscache_wp/commit/af696de1e174399f8165ac3a58f98fa99ccefb4b](https://github.com/litespeedtech/lscache_wp/commit/af696de1e174399f8165ac3a58f98fa99ccefb4b)
 * Will see in v3.0.
 * Thanks again.
 *  Thread Starter Anonymous User 13711045
 * (@anonymized-13711045)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12402218)
 * Sweet. Looking forward to 3.0.
 *  [juanxcursed](https://wordpress.org/support/users/juanxcursed/)
 * (@juanxcursed)
 * [6 years ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12824494)
 * Hi everyone, any updates on this? I’m on version 3.0.8.6 but still getting this
   error

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

The topic ‘REST API Cache TTL’ is closed to new replies.

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

 * 8 replies
 * 4 participants
 * Last reply from: [juanxcursed](https://wordpress.org/support/users/juanxcursed/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/rest-api-cache-ttl/#post-12824494)
 * Status: resolved