[MGNLUI-346] Assets App: All instances of an image in the UI should update when the image is edited. Created: 26/Nov/12  Updated: 11/Feb/13  Resolved: 06/Dec/12

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.0
Fix Version/s: 5.0

Type: Bug Priority: Blocker
Reporter: Christopher Zimmermann Assignee: Christopher Zimmermann
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLIMG-103 Set a header on responses instructing... Closed
relation
is related to MGNLUI-340 Images and assets should be cached on... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

When an image is cropped and the changes are saved, the binary of the asset is properly updated. But all the instances of the image (except in the crop tool itself) in the UI continue to show the old image. As soon as the editor is closed, all instances should be updated to reflect the actual image of the asset.

Where is the problem?
Note that if you get the url (right click) on the preview image of the asset after the edit, and paste it into a new browser tab - you will see the edited image properly. Then if you click on the thumbnail or item in the list or tree, the preview will be updated to the proper image.

This indicates that it is the browser that has a cached instance of the old image.

Suggestion:
After editing the image, perform ajax requests to get the new images in the browser. Once that is successful, perform a refresh on the preview and list view so that the images on the page are refreshed with the new images.

Alternatively an easier way would just be to append a "cache buster" Query string on all the image requests in the admin ui such that all images are always reloaded. i.e. a random, date seeded number image.jpg?cb=r83904834903.
But this will negatively impact the performance of the admin interface.
The preview and list would still need to be refreshed.



 Comments   
Comment by Christopher Zimmermann [ 05/Dec/12 ]

Moved to MGNLUI as that is where the code fix is.

Comment by Christopher Zimmermann [ 05/Dec/12 ]

The "dependent" ticket of setting headers to no-cache fixed the problem for the thumbnails, but not for the preview image in the action bar.
To get the preview image to update I added a cache busting querystring (System.currentTimeMillis()) in Actionbar.setPreview().

Comment by Christopher Zimmermann [ 06/Dec/12 ]

After more testing I note that the thumbnails are NOT updated when i close the editor after a crop action.
The headers on the images are definitely set to no-cache.
Firefox seems to have an "in-session" cache regardless of headers.

I think a cachebusting querystring on the thumbnail image url's might solve this.

Comment by Christopher Zimmermann [ 06/Dec/12 ]

Added cachebuster querystring to thumbnails in VThumbnail.setData.

Generated at Mon Feb 12 08:35:58 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.