• Resolved Jochen

    (@jochenwdm)


    Hi everyone,
    I hope someone has an idea how to get this fixed.
    I’m have a WP page with FrontEndUsers. FrontEndUsers should see different content.
    I tried to set a Coockie to stop showing the chached versions of the pages:

    in .htaccess:

    RewriteCond %{HTTP_COOKIE} ^((?!frontenduser).)*$
    RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_

    This is correctly working in Firefox. However when I use the page on Chrome it isnt working. When the users are logged in they see the cached version, due to browser caching. I saw, that its working with your code (Coockie = wordpress_logged_in_XXX) so I made a workaround and just set a coockie like wordpress_logged_in_frontenduser. Works great in Chrome. Now I tested the page in Edge and have the same problem. Do you have any idea how to fix this problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Torsten Landsiedel

    (@zodiac1978)

    Hi @jochenwdm

    are you talking about this plugin?
    https://de.www.ads-software.com/plugins/front-end-only-users/

    I am not sure I get the problem correctly. I think FrontEndUsers have to be logged in, so we shouldn’t create a cache if this is disabled via settings:
    https://github.com/pluginkollektiv/cachify/wiki/en-Settings#cache-generation-no-cache-generation-by-logged-in-users

    The line you already mentioned
    RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
    is preventing the redirect to the cache in case there is a logged in user.

    What is the exact problem you seeing at the moment?

    When the users are logged in they see the cached version, due to browser caching.

    This should not be the case because the login cookie should be preventing this …

    All the best
    Torsten

    Thread Starter Jochen

    (@jochenwdm)

    Thank you for the quick reply.

    I’m not using a plugin, I’m using a self developed system. I’m using the cookie only for cache controlling.

    Here is some hopefully better explanation to my problem:
    Normal user watching the page:
    – normal content is showing
    – content should be cached
    – user will see cached content

    Member is watching the page:
    – extended content will show up on the same page
    – content shouldn’t be cached
    – members shouldn’t see cached version of normal users

    So actually there are two problems. First one is to show the non cached version of the page to members. This works with the htaccess redirect condition but only in Firefox (and Chrome, if I add the wordpress_logged_in_frontenduser var to the Cookies). IE, Edge is still showing the cached version of the normal users page, even with the htaccess redirect functioning. I think this is some strange browser cache problem.

    This should not be the case because the login cookie should be preventing this

    Yes indeed, that’s what I thought. I double checked it and the cached content is not from the members page.

    The second problem is, that the members will also generate a cached version of their page (actually this is not happening right now, maybe because of the wordpress_logged_in_frontenduser Cookie??). So that normal users may also see the member content (depending on whoever first visits the page).

    Is it possible to add a WP filter, action or code line to not generate a cachify cache if frontendusers are viewing the page? In my situation the users a non WordPress Users and not logged in to the WP System.

    Best regards
    Jochen

    Thread Starter Jochen

    (@jochenwdm)

    Hi Torsten,
    I think the problem is solved, thank you for your help.

    Setting the Cookie “wordpress_logged_in_frontenduser” sets the status to a logged in user (as far as I can see in cachify.class.php). This also disables the caching, when that option in the cachify settings is enabled.

    This might also be a future feature for other people in the settings of cachify: e.g. enter the name of your cookie that should disable caching and rewrites.

    The problem with the htaccess rewrite might had to do with the Apache-Content-Cache. Since I disabled the Apache-Content-Cache the problem is gone.

    Again Thank you. Also for this realy great plugin!!

    Best Regards
    Jochen

    • This reply was modified 4 years, 2 months ago by Jochen.
    Plugin Support Torsten Landsiedel

    (@zodiac1978)

    Hi @jochenwdm

    great to hear everything is working now! And thanks for getting back and report how you fixed it.

    Will share your idea with the other devs.

    Thanks again!

    All the best
    Torsten

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Diable Caching for FrontEndUsers’ is closed to new replies.