Persistent links for attachments

One of the patterns that we’re developing is to use Discourse categories for working group management. It’s a great way to have smaller group discussions that are publicly visible and provide resources to the community. To that end we’ve been attaching documents to the posts that are important to the group’s communications etc. Sometimes things just don’t fit into post text.

As the knowlegebase has been growing up these semi-authoritative documents have become referenced externally. This has worked well until recently the CDN was changed for our discourse instance. And now all of the links to the attachments are broken. It would be great to support having a stable link to the attachments for reference/citation.

When the CDN was updated all the embedded links in the posts were correctly updated. But the external references were broken because the only links to the attachments are directly to the CDN endpoint.

It would be great to provide a persistent url so that external references to the attachments do not change.

There are two approaches that jumped out to me as being possible appraches. The first is to advertise a local url as the link. But it is just an http style redirect to the appropriate CDN endpoint so that any agent fetching the URL will then just move on and fetch it from the CDN. This incurs the cost of a small page load for every link but gives more control/consistency.

As an alternative, a possible way that would not work as universally, but could be managed for high value items would be to allow creating Permalinks in the admin console to the high value attachments. Right now Permalinks can go to a Post, Topic, or Category by ID. If that was extended to support Attachments we could use the explicitly created permalink for external citation.

As an example of this our TSC Charter is attached to this post:

It was orginally available from: https://discourse-cdn-sjc2.com/standard17/uploads/ros/original/2X/5/51feec4148e3c458856526ad4bcf44d9912c4c9a.pdf but with the CDN change it’s now posted at: https://aws1.discourse-cdn.com/standard17/uploads/ros/original/2X/5/51feec4148e3c458856526ad4bcf44d9912c4c9a.pdf

It would be great to have it work at a url like:
https://discourse.ros.org/uploads/ros/original/2X/5/51feec4148e3c458856526ad4bcf44d9912c4c9a.pdf which would then redirect to the appropriate CDN endpoint.

An example of a place that we want to externally reference the document can be found here: Update link to charter doc by gerkey · Pull Request #282 · ros2/ros2_documentation · GitHub where we had to update the link for the new CDN despite the content not changing.

1 Like