• Resolved confusedneedhelp

    (@confusedneedhelp)


    Hi,

    I am trying to achieve the following:

    1. Page is cached dynamically with cookie ‘XXX’ not present.
    2. Visitor arrives at cached page.
    3. Visitor completes form and cookie ‘XXX’ is added.
    4. Visitor is redirected to another page.
    5. Visitor returns to original page.
    6. Visitor views non-cached page.

    I have tried using

    add_filter( ‘sgo_bypass_cookies’, ‘add_sgo_bypass_cookies’);

    but it seems this will only stop the page being cached if the cookie is present. I need it to effectively bypass the cache if the page is already cached and the cookie is present.

    I hope this makes sense, any help is appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Vladimir Trandev

    (@vtrandev)

    Hello @confusedneedhelp,

    We monitor whether your browser has certain cookies and bypass the cache if they are present. For some, we monitor the value of the cookie while for others, just the cookie itself is enough. We would like also to clarify that pages containing personal data should be excluded by default, by referring to certain URL matches.

    In order of us to have a better idea of the exact setup that you would like to achieve, please submit a support ticket in your Client Area at Siteground and we will be glad to help.

    Regards,

    Vladimir

    Thread Starter confusedneedhelp

    (@confusedneedhelp)

    Thanks for your reply but that didn’t really answer the question. Can you clarify that bypass cache means that the the page is not cached or that the already cached page is not viewed.

    The reason is that after adding the cookie to the filter I am still seeing a cached page. The cookie is a date which is not showing when the page is revisited. I confirm that the cookie is present.

    Plugin Support Pavel Dosev

    (@pdosev)

    Hello @confusedneedhelp

    The sgo_bypass_cookies filter works only for File Based Caching. It does not affect the Dynamic cache.

    Still, the Dynamic Caching functionality excludes, by default, the most commonly used cookies. You may find a list of all of the cookies that bypass the cache in the article below:

    https://www.siteground.com/kb/siteground-dynamic-caching-configuration/#Cookies

    If you want to use a custom cookie that is not excluded from the Dynamic caching, you can use headers to manage cache control. We support all the standard Cache-control header values.

    cache-control: no-cache – passing this header tells our system not to cache this request
    cache-control: max-age – this header tells our system to cache this request for X amount of seconds

    You can also use the nocache_headers()core WordPress function to bypass cache.

    Thread Starter confusedneedhelp

    (@confusedneedhelp)

    Ah ok, now I understand it. Thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bypass Cache with Cookie after page has been cached’ is closed to new replies.