• Resolved igor4wp

    (@igor4wp)


    Hi guys,

    Over the last couple of months (since approx. 8th of Feb), I was trying to identify the root cause for Cloudflare’s APO cache BYPASS.

    Long story short, my hosting provider didn’t find anything on their end, and Cloudflare’s support blames
    Set-Cookie
    pll_language=en; SameSite=Lax; Secure; Path=/; Max-Age=31536000; Expires=Wed, 22 Apr 2026 19:27:00 GMT
    That technically might be the case, as setting a cookie is indeed a trigger for cache bypass.
    However, I was using both Polylang and CF APO for years with no significant issues whatsoever.

    The most “exciting” part is that this is not happening all the time, it rather comes and goes (for some short period of time).

    Any suggestions?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter igor4wp

    (@igor4wp)

    To make a picture complete, along with APO, we also use a CF worker that does conditional redirection on the edge server.

    Tricky point: the moment we disable that CF Worker Route APO works as expected!

    To exclude the possibility of errors in the worker we created a test worker with litteraly nothing in it and it was triggering BYPASS too.

    AI-driven troubleshooting suggested the following solution:
    Prevent Polylang from Setting the Default Cookie. 
    Modify functions.php to use a Polylang filter to stop it from sending Set-Cookie: pll_language=en when serving the default language via fallback. This removes the specific header that APO is likely reacting negatively to when it receives a response from the origin.

    Not sure if this is the right suggestion and what exactly we should add/amend in functions.php, but I hope this brings more clarity and increases the chances of fixing our issue.

    Thread Starter igor4wp

    (@igor4wp)

    Most likely, our issue has very little to do with Polylang cookie – rather ist’s a glitch on the Cloudflare side

    See this thread for more details and workaround solution.

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

The topic ‘Polylang cookie conflicts with Cloudflare APO’ is closed to new replies.