• Resolved kochtopf

    (@kochtopf)


    I did upgrade to 2.10.4 and run into the following situation. But maybe it’s designed this way. I activated the cache (86000 seconds).
    1. Create a new post and save it as draft.
    2. preview the post and show metadata. The metadata are OK and cached.
    3. Edit the the post and preview again. The metadata are wrong – the old cached version from 2. is presented.

    I think its a minor problem because once you publish the post the metadata are corrected and recached. To me it looks like hitting ‘save draft’ and or ‘preview’ do not clean the cache. Old info are presented until you finally hit ‘publish’. After that all metadata are good again.

    https://ww.wp.xz.cn/plugins/add-meta-tags/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author George Notaras

    (@gnotaras)

    Hi, currently, the cached metadata of a post is auto-purged when a post transitions from one state to the other and one of the two states is ‘publish’. Truth is I hadn’t given it much thought about the need to review metadata while the post is still a draft. Apparently this has to be taken into account. Thanks for pointing it out!

    The code that would purge the cached metadata on every save is already there, but is commented out. If possible, please try uncommenting this line of the /wp-content/plugins/add-meta-tags/add-meta-tags.php file and please check if this works as expected.

    George

    Plugin Author George Notaras

    (@gnotaras)

    Alternatively, maybe it should be left as is, but prevent the metadata from being cached if the post is a draft (or better if none of the two states is ‘publish’). It’ll need some experimentation. I’ll try to look into this very soon.

    Plugin Author George Notaras

    (@gnotaras)

    I think I’ll go ahead with setting it to not cache the metadata if the post isn’t published and leave the current logic with auto purging as is. That seems to make more sense.

    Thread Starter kochtopf

    (@kochtopf)

    uncommenting this line of the /wp-content/plugins/add-meta-tags/add-meta-tags.php file and please check if this works as expected.

    Indeed worked perfect. Whatever you decide to implement for future releases – this modification is working very well. Thank you for reading.

    Plugin Author George Notaras

    (@gnotaras)

    Hi, I’ve released 2.10.5 in which metadata is not cached for post objects (posts, pages. attachments, custom post types, products, etc), unless they have been published. I think this makes the most sense of the two possible resolutions, especially since the triggering of the auto-purging is also based on the post status.

    I’ve also corrected another minor issue with the clean up of the whole metadata cache from the WP database when the plugin settings where saved. I discovered that WordPress also creates an extra object regarding the real transient object’s timeout. This was undocumented and previous AMT releases didn’t clean those up properly. Now this has been fixed. To the best of my knowledge now caching works without any issues.

    Thank you for your useful feedback!

    Best Regards,
    George

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Working on drafts if metadata cache is active’ is closed to new replies.