WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#32302 new defect (bug)

Filename policy of IMAGE_EDIT_OVERWRITE==true seems to create CDN and browser cache issues

Reported by: aidanlane Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Media Keywords:
Focuses: docs, administration, performance Cc:
PR Number:

Description

Just something to check, as discussed over at https://deliciousbrains.com/undefined-define-image_edit_overwrite/

It states the behaviour:
"When you add define( 'IMAGE_EDIT_OVERWRITE', true ); to your wp-config.php the behaviour changes. When you edit an image, it still creates a new image and leaves the original image alone. But when you edit again, it overwrites the first set of images rather than create a new set."

My comment: "what about CDN and browser caching? If the "unique appendage" didn't change, then readers won't see the updated image until the cache expires, which for our site at least is 'forever'. If the first edit were to be deleted, wouldn't it be more sensible to still generate a new "unique appendage", rather than using the same one? But then again, that could break existing references to the first edit... oh my it becomes messy quickly!"

Brad's reply: "Excellent point! I think you're right. When IMAGE_EDIT_OVERWRITE is set to true, it should create a new unique appendage instead of reusing the old one. You should open up a Trac ticket for this to be looked at and discussed."

Are you able to provide any clarification?

Many thanks,
Aidan

Change History (8)

#1 @nacin
4 years ago

If I recall correctly, this constant was randomly added when the image editor was merged in from an existing plugin in 2.9. It had little review and probably shouldn't have existed as it does.

#2 @aidanlane
4 years ago

Interesting... wow, that goes all the way back to 2009: https://codex.wordpress.org/Version_2.9

I'm guessing that the ramifications of changing its behaviour would be too large.

Perhaps it just needs a cautionary note in the docs of potential caching issues if used?

Btw, related issue: https://core.trac.wordpress.org/ticket/32171

Thanks again!

This ticket was mentioned in Slack in #core by jorbin. View the logs.


4 years ago

#4 @jorbin
4 years ago

  • Version changed from trunk to 2.9

#5 follow-up: @DrewAPicture
3 years ago

@mikeschroder Best suggestion on where we'd most benefit from documentation for this largely undocumented constant?

#6 in reply to: ↑ 5 ; follow-up: @mikeschroder
3 years ago

Replying to DrewAPicture:

@mikeschroder Best suggestion on where we'd most benefit from documentation for this largely undocumented constant?

Hah, I'd considered asking you the exact same question, when commenting on it in a different ticket, as I'm unsure of the best place for it.

Where do we have most of the constants documented? The codex wp-config.php page?

#7 in reply to: ↑ 6 @DrewAPicture
3 years ago

Replying to mikeschroder:

Replying to DrewAPicture:

@mikeschroder Best suggestion on where we'd most benefit from documentation for this largely undocumented constant?

Where do we have most of the constants documented? The codex wp-config.php page?

Yeah, I think that's currently the canonical source.

This ticket was mentioned in Slack in #docs by morganestes. View the logs.


3 years ago

Note: See TracTickets for help on using tickets.