• Resolved tmobilon

    (@tmobilon)


    Hi there,

    This bug started after upgrading to Yoast ~14.2. I’m currently using v14.3.

    When an author is editing a post and then clicks in “preview”, Yoast saves all the meta information in the object cache. That includes: canonical url, post thumbnail (saves the default image), Breadcrumb, etc.

    Then when the post is published, this information isn’t flushed immediately. The canonical stays wrong (?p=312123) and the image thumbs for twitter, google and facebook is the default.

    To flush this infos, i need to wait a few minutes and then update the post.

    I’m using a Redis Object Cache from Pressjitsu, but the problem is not specific to this opt-in. I’ve already tried to change it to other two WP Redis, and the problem persists. In fact, with this other plugins, even more information is saved, as the breadcrumbs.

    Is there a way to stop Yoast from caching stuff when it’s from a post preview URL? I believe that this could fix the error.

    I’ve tried removing Yoast header stuff using this code, but it doesn’t fix the problem, since the information is already cached when “template_redirect” is beeing called:

    add_action( 'template_redirect', 'remove_yoast_postpreview' );
    function remove_yoast_postpreview() {
        if ( is_user_logged_in() && is_preview() ) {
            $front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class );
    
            remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 );
        }
    }

    Maybe there’s a way to stop Yoast from the “init” action, when the request is from a post preview?

    Any thoughts?

    • This topic was modified 4 years, 5 months ago by tmobilon.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter tmobilon

    (@tmobilon)

    Hi there, just to add one information:

    We also have HTML cache in NGINX, so what happens is that the metadata from the preview also goes to the HTML cache, that lasts for 48 hours. To flush that, i would have to go from post to post, and hit the “update” button.

    We publish almost 40 posts everyday, so that’s not a very practical solution.

    I also didn’t change any configs in our setup: no new plugins, configurations, etc. The bug simply started after upgrading to Yoast 14.x version.

    Of course, if i disable Redis Cache, the problem goes away. But as i mentioned before, we are using the same setup and this problem didn’t exist before upgrading.

    So, does Yoast really need to store this keys in the object-cache while in post preview?

    • This reply was modified 4 years, 5 months ago by tmobilon.
    Plugin Support Michael Ti?a

    (@mikes41720)

    Hello @tmobilon

    Could you please check this GitHub issue if it is similar to your encountered issue regarding the post preview and not showing the correct metadata when publishing? If so, please add all of the relevant information to your case so our developers can take a look and try to reproduce the issue or provide more information.

    Thread Starter tmobilon

    (@tmobilon)

    Plugin Support Michael Ti?a

    (@mikes41720)

    Thank you for providing the relevant information for this case! Please feel free to subscribe to the issue on GitHub for further updates and comments.

    Plugin Support Jerlyn

    (@jerparx)

    Hi @tmobilon ,

    We’re now tagging this thread as resolved as a GH reported had been submitted. For any updates on the issue created, please check/follow the GH link.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Yoast saving post preview info in Object Cache’ is closed to new replies.