Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vuture

    Thank y9ou for your inquiry and I am happy to assist you with this.
    Just to clarify, you want your pages to be cached for logged in users and the admin bar is also cached on all pages?
    Also, the first screenshot throws HTTP ERROR 404 so can you please double-check the link.
    Thank you!

    Thread Starter vuture

    (@vuture)

    Hello Marko,

    thanks for your fast answer!

    Yes, we need to cache pages for everyone (logged in + logged out) and load the dynamic content via ajax.
    The same method would be great for the admin bar.
    It could even be a feature of your plugin, which would be great for all who want to cache for logged in customers.

    Thank you in advance,
    Chris

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vuture

    Thank you for the clarification.
    First I must say that caching your front-end for logged in users is something that is really not recommended. You can encounter a lot of issues, and some users may have some important information cached and in this case, the other users may see that info.
    SO I’d strongly advise you to disable caching for logged in users especially if you have customers entering private details.
    Be that as it may, the thing that needs to be changed in the code provided in the other forum topic is to change all of the $ to jQuery.
    I hope this helps!
    Thank you!

    Thread Starter vuture

    (@vuture)

    Hello Marko,

    I understand your concerns, thank you for the information.
    We were investigating for a long time to get a solution for this.
    If you use ajax for dynamic content (user based data), then there is no issue with caching for logged in users.

    If we don’t do that, we can’t provide the same service for logged in users.

    It works now, but only with the option enabled (never cache for admins, etc.)
    https://1drv.ms/u/s!AikSNhBAk4tevRLN9Z1jigJRe829

    So the issue still is, that you don’t get a cached version as an admin, don’t get the feeling of the page or see issues if something is wrong with the cache.

    On WP-Rocket the admin bar never gets cached for logged out users, even if you preload the pages as a logged in user.
    So the admin bar gets loaded very fast (faster than ajax), and only shows up for the correct logged in users.

    Maybe you could implement such a feature as well, this could help many of your users.

    Bigger Companies want to be able to cache everything and smaller one-man businesses mostly don’t have much dynamic content, so they can cache for logged in&out as well.

    This could be the beginning of providing good and easy caching methods, even for smaller businesses.

    Thank you in advance,
    Chris

    • This reply was modified 4 years, 5 months ago by vuture. Reason: Additional information + status update
    • This reply was modified 4 years, 5 months ago by vuture. Reason: merging&organizing content
    • This reply was modified 4 years, 5 months ago by vuture.
    Thread Starter vuture

    (@vuture)

    Hello,
    to make it easier, I divided the issue in 2 parts.

    Issue 1)
    As soon as I enqueue the javascript file via functions.php, our page gets “doubled”.

    function wpb_adding_scripts() {
    wp_register_script('my_amazing_script', get_stylesheet_directory_uri() . '/assets/js/script.js', array('jquery'),'1.1', true);
    wp_enqueue_script('my_amazing_script');
    }
      
    add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' ); 

    I also tried:

    function add_javascript() {
    	wp_enqueue_script( 'add_javascript', get_stylesheet_directory_uri() . '/assets/js/script.js', array('jquery'), false );
    }
    add_action( 'wp_enqueue_scripts', 'add_javascript' );

    The page loads as usual and below our page, a clone of the page appears.
    Maybe you see why this happens?

    Issue 2)
    “Don’t cache pages for following user roles” doesn’t work properly.
    Sometimes it works, and if I reenable it, it doesn’t.

    Thank you,
    Chris

    • This reply was modified 4 years, 5 months ago by vuture.
    • This reply was modified 4 years, 5 months ago by vuture.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vuture

    Thank you for the information.
    Let me check this with the team and I’ll get back to you on this.
    Once again thank you for your suggestion.

    Thread Starter vuture

    (@vuture)

    Hello Marko,

    thank you for your fast answer, that sounds great!

    Update:
    Issue 1) Still persists.

    Issue 2)
    It just takes some time to take effect, but it seems to work now.

    I am looking forward to your answer.

    Have a nice weekend,
    Chris

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Admin bar gets page cached + shows for non logged in’ is closed to new replies.