Rebake after CDN change missed old posts

Discourse admin recently alerted me that I should consider using a CDN instead of serving direct from S3. I had considered doing it in the past, but the cost seemed high and unnecessary for our small community. Now I see that the cost is much lower, so I set it up. I made a Cloudfront distribution point at the existing bucket, and then I added its URL to discourse. Then I did a full rebake.

The rebake ran and completed without issue. Making a new posts works fine and use the CDN. Posts newer than 2018 or so (I didn’t check the exact cutoff date) has been correctly updated to point at the CDN. But posts from 2017 and older don’t seem to actually be rebaked. They still have URLs pointing directly at the S3 bucket. I’d like to get those posts rebaked properly so I can disable public access to the S3 bucket with confidence that it won’t break things.

Not sure what else I can do though? Any ideas? Thanks.

1 Like

Oh wait, hold on. I think I might know the issue, I just need to confirm.

When you run rake posts:rebake does that actually rebake all the posts immediately or does it simply queue jobs into sidekiq that will then do the actual rebaking? I noticed that I now have a huge pile of Jobs::PullHotlinkedImages queued up, which makes a heck of a lot of sense. If there are still posts that need rebaking after the queue is clear, then I guess I have a problem. Otherwise, all is well.

1 Like

Yes, this is correct – it’s a background process that should go in order of newest posts → oldest posts, so the newest posts are processed first, then the giant backlog of older posts.

1 Like