• Resolved fidoboy

    (@fidoboy)


    Is it possible to create a separate page cache based on a given cookie value? I have a WordPress plugin that serves different page content based on a cookie stored on the client browser, so I need that the same page is stored separately if the cookie is present with a certain value. Is this possible with this plugin?

    Thanks in advance,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @fidoboy,
    If your page response header has Set-Cookie then Cloudflare will not cache the page anyways. But, if you want to show different page cache based on cookie, unfortunately that is not possible.

    Thread Starter fidoboy

    (@fidoboy)

    I understand. I was considering this feature like in WP Rocket that I’m currently using: https://docs.wp-rocket.me/article/1313-create-different-cache-files-with-dynamic-and-mandatory-cookies

    Without this I can’t do the migration.

    Plugin Contributor iSaumya

    (@isaumya)

    I understand but this is not possible. Because this plugin doesn’t cache content at the disk level like WP Rocket. Instead it’s cache content at the CDN level. And at the CDN level we can’t create separate cache based on cookies. Also when a page has cookies Cloudflare always recommend not to cache the page as the page content needs to be dynamically generated based on the cookie value. So, it must need to be fetched from the origin server.

    Thread Starter fidoboy

    (@fidoboy)

    What a pity

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Separate cache for a given cookie value’ is closed to new replies.