-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WYSIWYG interface should append cache-buster in image query (#15309) #23439
Fix WYSIWYG interface should append cache-buster in image query (#15309) #23439
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, @SP12893678 ❤️
I remember having explored a similar approach for this issue in the past.
It's tricky though when directly working on the TinyMCE DOM.
For example, the cache-buster URL parameter is persisted when saving the item (arguably also not ideal) and when loading again with an image that has changed in the meantime, we would have to update the parameter which means the WYSIWYG field appears as "edited" even though the user has not made any changes themself.
Even if we remove the parameter from the URL when saving (might be complex), we would still have to inject it again when loading, so the field is "edited" again.
Tricky, tricky, ...
One idea that came to my mind is to set up a service worker, which intercepts the image requests and ensures the correct ones are fetched/returned. So we wouldn't have to mess around with the DOM. Not sure if that's feasible (especially with requests from iFrames).
Marking as a draft for now, also since I've noticed other issues with the current solution (cache buster param seems to be applied only at the first page load, ...)
Thanks for your suggestions in detail! 😆 |
Not entirely sure how that would work, since the service worker would need to know the |
I was thinking the service worker could request that info from the main thread. |
Thanks @SP12893678! I think for a starter, it would be interesting to see whether it's possible to intercept request coming from a iFrame (TinyMCE) in the first place. And maybe if there's a way to distinguish them from requests made in other places (though, perhaps it would even make sense to apply such a cache busting logic to all internal image requests?). |
I have do some research for that.
Aspect of Tinymice:
By the way, Tinymice provide I have tried to test it in our project, and test-used project. |
3b57538
to
c8f3e22
Compare
Heyo! Thank you for the PR. We are going to close this out because the associated issue has been closed. We’re not planning to dynamically add cache buster query params in the WYSIWYG field, as doing so would introduce unnecessary complexity. |
Scope
WYSIWYG images did not have cache-buster mechanism.
It lead show old version image.
What's changed:
Potential Risks / Drawbacks
Review Notes / Questions
modified_on
oruploaded_on
for image cache-busterFixes #15309