When replacing asset keep same url

Is your feature request related to a problem? Please describe.
When uploading assets and using them in rich text fields, which we are doing quite a bit, when replacing the assets in media we expected the url to remain the same so that all the links would point to the new asset. Unfortunately the url changes every time we use “replace asset”, making the user have to know where that asset is being linked to and manually go and update them. We also may use these urls outside of the CMS which would cause more headache.

Describe the solution you’d like
The ability to keep the original url of the asset when it’s replaced.

Describe alternatives you’ve considered
We have to manually update urls and it gets hard to remember where everything is used to update.

Sorry but our CDN has to be considered immutable: you cannot change the content of an existing URL afterwards. This allows us to be extremely fast and forever cacheable.

So what are we supposed to do when someone adds an asset to a markdown or html block and they update that asset in the CMS backend? It won’t update automatically and there is no indicator that the file url needs to be updated in different places.

@flipxfx I think the best way to deal with this is to use a modular content with an asset so that you can avoid having lost links inside.

If you really cannot avoid the markdown the only idea I have is that you set up some webhook and you take care yourself to update the URLs of the images whenever you change the assets :frowning:

Yes our users link to documents and like to put pictures mid-content for blogs etc. It would be awkward to have to use modular content just to put links to things. :thinking:

We found it sort of misleading since you can choose images to place in HTML/Markdown blocks via the media explorer. If there’s no good way to fix this I would at least warn the user that the asset they pick will not be updated if it’s updated via media.

If there’s no way for this to work correctly with the current CDN what would a webhook like this look like? Or is there some way to have urls in-front the CDN that don’t change or a way to invalidate?

Makes sense what you are saying.

We are going to try something out to see if that is not too heavy on our DB, not sure when, but we are going to try something out.

@matjack1 Was there any progress on this feature examination? We just discovered this same issue rolling out a DatoCMS driven blog to non-technical end-users. Their perfectly acceptable expectation is that an incorrect image can be replaced using the “replace” function. We also have some rarely changing assets such as PDF privacy policies linked in the footer that now require developer intervention to update.

While I understand the CDN argument that @stefano.verna makes at the top of this thread, it’s not really acceptable by 2020+ expectations. Most (all?) CDNs allow asset invalidation for this very reason.

@troy.forster your argument makes sense for sure. We’ll try having a look as we’ll probably work on something related.


Hey @mat_jack1 – just wanted to follow up here and say that we also found ourselves needing a feature that would allow us to replace files/media while keeping the same URL. Was there any progress this year? Thanks

Hey @kenny this problem persists as it’s a base behaviour of our image management right now. We have improved in deleting unused assets, but we don’t have yet a way to implement redirects sorry. We know it’s useful but it’s a problem that we should address on a very low level that at the moment is still quite complex, sorry :frowning:

1 Like

Same problem here. Couldn’t the solution be a manual or automatic redirect as requested here?