Title: Caching through languages
Last modified: May 30, 2019

---

# Caching through languages

 *  Resolved [manuelpette](https://wordpress.org/support/users/manuelpette/)
 * (@manuelpette)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/caching-through-languages/)
 * Hi,
 * first I’d like to thank you for the great plugin!
    It worked great so far but
   I am having issues with multilanguage management. I built an app on top of a 
   WP website that uses QTranslate X to manage multilanguage content. If the content
   gets cached in the main language and then I change language, the content returned
   from following requests is still in the main language. Endpoints structure is
   the basic WP [domain]/wp-json/wp/v2/[post_type] and when its not in the main 
   language its: [domain]/[LANGCODE]/wp-json/wp/v2/[post_type]. I tried to add the
   language=[LANGCODE] parameter to the call too but nothing changes, response is
   still in the cached language.
 * Thanks in advance for your help.

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

 *  Plugin Author [Acato](https://wordpress.org/support/users/acato/)
 * (@acato)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/caching-through-languages/#post-11598530)
 * Hi [@manuelpette](https://wordpress.org/support/users/manuelpette/)
 * Thank you for using our plugin!
 * We use MultilingualPress for multilanguage websites (which has it’s own subsite
   for each language and thus the caching is per subsite), so I do not have any 
   experience with qTranslate X. So unfortunately at this point I do not have an
   answer to your question and will first have to investigate this.
 * However: adding the language=[LANGCODE] as a parameter to the call should solve
   the issue, since a call to `/wp-json/wp/v2/[post_type]` should result in a different
   cache being created than a call to `/wp-json/wp/v2/[post_type]?language=[LANGCODE]`.
   So I am a little puzzled as to why both return the cached language. Could you
   check if indeed two seperate caches are created? You can check by visiting Settings
   > WP REST Cache > Tab: Endpoint API Caches
 *  Thread Starter [manuelpette](https://wordpress.org/support/users/manuelpette/)
 * (@manuelpette)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/caching-through-languages/#post-11610811)
 * Hi [@acato](https://wordpress.org/support/users/acato/)!
 * Thanks for getting back to me! I solved the issue this way (for anyone who might
   end up here with the same problem): I built custom rest api endpoints returning
   only the information i needed (to improve performance even further) registered
   them to be cached as per your FAQ section ‘Can I register my own endpoint for
   caching?’. This way for some reason the cache actually recognizes the language
   =[LANGCODE] parameter as a totally different endpoint. Since the code is now 
   working I didn’t investigate the previous issue further but it might have been
   there because of some qTranslateX intervention (I am not a fan of this multilingual
   plugin 😀 ).
    Thanks for getting back to me anyway and congrats for the great
   plugin!
 * Keep up the good work!

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

The topic ‘Caching through languages’ is closed to new replies.

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

 * 2 replies
 * 2 participants
 * Last reply from: [manuelpette](https://wordpress.org/support/users/manuelpette/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/caching-through-languages/#post-11610811)
 * Status: resolved