Make WordPress Core

Opened 10 years ago

Last modified 8 months ago

#32302 new defect (bug)

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

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

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 (9)

#1 @nacin
10 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
10 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.


9 years ago

#4 @jorbin
9 years ago

  • Version changed from trunk to 2.9

#5 follow-up: @DrewAPicture
8 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: @kirasong
8 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
8 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.


8 years ago

#9 @pbearne
8 months ago

do we need to work on this?

Note: See TracTickets for help on using tickets.