The discussion revolves around an issue with the “Content Disposition” HTTP header missing when downloading images on certain Discourse instances. This results in the images not being prompted to be saved as a file.
Reproduction and Debugging
The issue is not present on meta and try instances, which use a CDN for file downloads.
The problem seems to be related to the Rails Engine being mounted, as mentioned by sam.
eviltrout initially couldn’t reproduce the issue, but later found that the posts that couldn’t be downloaded were missing the data-download-href attribute.
Solution
Rebaking the individual posts fixes the download link for all images in the post.
The data-download-href attribute was added on October 15, 2014, as seen in this commit.
DeanMarkTaylor suggests adding clear instructions for rebaking, a “Rebake all” button in the backend, and handling future required rebakes.
Concerns
DeanMarkTaylor expresses concerns about the impact of rebaking on the forum, including usability and backup issues.
I just checked locally and the large images downloaded file and had the Content-Disposition header.
Then I went to @Sam’s blog, clicked on the graph on this post and it also downloaded as a file. I checked the headers in Chrome and it too had the Content-Disposition
this is somehow related to the Rails Engine being mounted. Its was very hard to debug when I started looking adding it.
You should be able to reproduce this here somehow as well, since we are using akismet. Even if you bypass the cdn for the links
EDIT
@eviltrout header appears to be missing here https://meta.discourse.org//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/d/9/d9988c49657be1d3ade114885f695a1aa25f71ef.gif
Just to say I don’t know what might “mount an engine” - but this occurs on my instance which doesn’t have “tagger”, nor “akismet” but does have the following:
It looks to me like the posts that can’t be downloaded on Sam’s site don’t have the data-download-href attribute. That attribute was added about a year after that post, so I think a rebake will fix it.
Clear instructions to rebake perhaps should be added for the point version upgrade it effects?
Rebake all button in the backend (with confirmation).
Handling future required rebakes - possible way of flagging upgrades / updates as requiring rebaking posts.
Rebake impact question - I’ve never done a rebake only the baking that was done automatically on forum import.
The baking process at the time of import actually took ~7 days - rebaking worries me as to it’s impact on the forum…
… it continuing to be usable and backups not causing an issue when running for multiple days.