• Resolved aaylasecura

    (@aaylasecura)


    The plugin adds a new ver parameter to the URL of the image if it had been replaced in order to force browsers to get the new image, rather than using a cached version. That’s great, however, the parameter is inserted in the wp_prepare_attachment_for_js hook and that seems to fire only when an image is inserted in the block editor (and not even then if using the default Image block in Gutenberg for some reason). This means that if an image is replaced, all existing references to it still don’t have the ver parameter (or have an old timestamp) and so users’ browsers may not show the updated image.

    I tested this by adding an image to a page using the default WordPress image block as well as a third party image block (Greenshift), and then replacing the image. The ver parameter was not added to either. Then I reinserted that image in the block editor and the ver parameter was added to the URL only for Greenshift’s image block.

    I think the ver parameter should be added/updated for all references to an image when it is replaced. I understand this may be tricky because the URL is hardcoded in the post/page content and only updated when the image is reinserted into the editor, but there are ways to update it and I think it’s important. I believe the whole point of the media replace feature is so that one doesn’t need to go and reinsert the image in the editor, everywhere it is used, when wanting to update it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Karina

    (@karinapremio)

    Hey there, thanks for reaching out. I can confirm that you absolutely shouldn’t need to update all images manually in the instances where they were being used. Can you please drop us a line at [email protected] and we’ll do our best to help you out?

    Thread Starter aaylasecura

    (@aaylasecura)

    Thank you for replying, I’ve emailed the details above to the given address.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Caching problems with replaced images’ is closed to new replies.