• Resolved abitofmind

    (@abitofmind)


    Hi, during “Replace Media Upload” you have this:

    Date Options
    When replacing the media, do you want to:
    ( ) Replace the date
    (?) Keep the date (18/Aug/2021 23:38)
    ( ) Set a Custom Date

    I wish the description and/or the FAQ would have addressed what consequences these options have. Meanwhile I found out myself by trial and error:

    “Keep the date” is the default. This can have bad consequences with browser caching! I am not talking about server caching or CDN here. This should specifically also be addressed in FAQ “I replaced a file, but it didn’t change!”.

    Environment
    – macOS 11.4 Big Sur
    – Safari 14.1.1

    Reproduction I
    1) Replace media with “Keep the date”.
    2) In normal view mode, access a page which embeds that media, via the menu.
    3) The browser shows the old outdated image.
    I assume because the HTTP timestamp header for the image file is unchanged (an eTag based on content hashing or comparing the HTTP size header should make clear that the file has indeed changed).
    4) A forced page reload then shows the new image. This is insufficient as returning visitors with a browser cache should not get outdated imagery but also the newest like fresh visitors.

    Reproduction II
    1) Replace media with “Replace the date”. (sets it to now)
    2) In normal view mode, access a page which embeds that media, via the menu.
    3) The browser immediately shows the updated image.

    Feature Improvement for “Set a Custom Date”
    – “Set a Custom Date” by default copies “now” into the field.
    – This is not a good init value as it’s redundant to option 1 “Replace the date”.
    – I propose the following:

    (?) Set a Custom Date
    [__________] [__] [__] Now | Original

    – The fields get initializing with the original timestamp.
    – Clicking the “Now” or “Original” action link/button update the date/time fields accordingly.

    • This topic was modified 3 years, 3 months ago by abitofmind.
    • This topic was modified 3 years, 3 months ago by abitofmind.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @abitofmind,

    The date options affect only the database, to be more specific the date of the attachment. Those date options do not affect in any way the file URL or any HTTP header, which is what the browsers use to cache or not cache the file. Having said that, we don’t and can’t know if the attachment date is relevant to the frontend, as that will depend on the on the frontend theme implementation (or the cache for that matter). It can check that date and do something with it, or not.

    So, in short, it sounds like you have some long cache in place which doesn’t get updated, so maybe you have some other cache system there. This article talks about this and about how to properly check that the image has or hasn’t been updated: https://help.shortpixel.com/article/158-in-enable-media-replace-the-image-isnt-replaced-why

    Notice that Enable Media Replace has an option where you can move the file to another directory, and that will actually change the file URL, so no cache issues will happen: https://i.imgur.com/HYejkkm.png

    In any case, I agree with you about adding the previous article and more information to our FAQ, as right now it needs some updating. Thanks for the suggestion, I will forward it to my colleagues ??

    I hope that helps!

    Thread Starter abitofmind

    (@abitofmind)

    1) Thanks for the detailed reply!
    2) Will use it to check out what’s the issue at hand.
    3) Glad that the general public will also benefit from this via an updated description/FAQ.

    Thread Starter abitofmind

    (@abitofmind)

    What about my feature improvement for “Set a Custom Date” ?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Sure, @abitofmind, we forwarded the feature request to our team as well. We will internally discuss if and how to add it to the plugin ??

    Thanks for your suggestions!

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hey @abitofmind,

    Can you please update the plugin to version 3.6? We implemented the feature improvement you asked for ??

    Have a good one!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Date Options: Please explain in description/FAQ + Impact on browser caching’ is closed to new replies.