• Hi

    I have a subscription website, where users can see restricted content after sign in and subscribe. If user is not logged in, the content is served partialy, with an error message.

    Problem is, if the user is reading some page without login, then see this error and then login on “my account” page, when he comes back to the page he was reading before, the content served is cached with the message error, as he was not logged in (but he is).

    If this user force his browser to flush cache using CTRL + F5, the refreshed page is correctly served.

    So… I think maybe I’m having some issue with browser cache.

    How can I force browser cache to clear after user logs in or how can I force W3TC or my browser to serve an uncached page if user is logged in?

    My browser cache configs:
    – Set Last-Modified header
    – Set W3 Total Cache header
    – Enable HTTP (gzip) compression
    – Prevent caching of objects after settings change
    – Don’t set cookies for static files
    – Do not process 404 errors for static objects with WordPress

    In page cache we are using: “Don’t cache pages for logged in users”.

    I’m also using Cloudflare.

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

    (@todorchristov)

    I have basically the same issue, though a bit different, as far as it is connected with WooCommerce and leaving a review. The reviews are restricted to logged in users only.

    When an user visits a product page as a regular visitor (guest) and wants to leave a review about certain product, he is invited to log in first. Then, he is not able to leave a review because he sees the login message/invitation again. The page is cached after he has logged in and he sees it again.

    Only after Ctrl+F5 (cache clearing) he is able to see the review form and fill it.

    Would be glad to hear some suggestions.

    TodorChristov

    (@todorchristov)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Serving cached pages after user logs in’ is closed to new replies.