PolyLang and DONOTCACHEPAGE




Wordpress LScache Plugin: PolyLang and DONOTCACHEPAGE

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello, I have a WP install which uses PolyLang to provide the infrastructure that allows us to run two sites off of one install (in a virtual sense) ? the default is English on an English domain and the other a French translation on a French domain. The English version is cached normally and performs like lightning! The French pages however have a long TTFB because they are served uncached. I believe this is because PolyLang needs to set a cookie on the translated site so that it can remember which language is selected. In order to do so, it sets the DONOTCACHEPAGE constant, thereby preventing the page from being cached. If I could direct your attention to this page youll find a discussion kicked off by the author of the WP Rocket plugin. Whilst it is a different caching plugin, the issue appears to remain the same, and the solution (scroll right down to the bottom) looks equally portable. Id love to hear your thoughts on this and whether you will be able to roll a solution into a nearby update. This topic was modified 4 years ago by Ian Pegg. Hi @ian, we are following a similar issue, we will get back to you shortly. Hi @ianpegg, Could you provide more details for reproducing this issue? 1) May I know which PolyLang version are you using 2) Is it just set up two languages and then all page in the second language pages got missed? Also, if you can send us a sample site it would be great. You can join our Slack channel or submit a ticket here for passing us the details. Thanks, Stanley Hi @stanleylitespeed, Joyfully enough, Ive just updated to LS 2.7.3 and PolyLang 2.4.1 and the issue now appears to have been resolved. After the page cache was subsequently cleared and then rebuilt both English and French versions began returning 25ms TTFB. Ill let you know if the issue resurfaces, but whether through deliberate effort or coincidence it looks like this issue has now been resolved. Thanks for all your help, Ian Thats great. Yes, feel free to let us know if it happening again. Thanks, Stanley



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference