Support » Plugin: LiteSpeed Cache » PolyLang and DONOTCACHEPAGE

  • Resolved Ian Pegg

    (@ianpegg)


    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 you’ll 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.

    I’d 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 1 year, 3 months ago by Ian Pegg.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support stanley@litespeed

    (@stanleylitespeed)

    Hi @ian, we are following a similar issue, we will get back to you shortly.

    Plugin Support stanley@litespeed

    (@stanleylitespeed)

    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, I’ve 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.

    I’ll 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

    Plugin Support stanley@litespeed

    (@stanleylitespeed)

    That’s great. Yes, feel free to let us know if it happening again.

    Thanks,
    Stanley

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PolyLang and DONOTCACHEPAGE’ is closed to new replies.