Olly Headey
๐ค SpeakerAppearances Over Time
Podcast Appearances
is still a mystery and and i i wasn't that interested enough to actually go and understand exactly why but i did document it in this article like here's what i did partly for my own benefit because like if i have to do this again i'm literally never going to be able to understand what to do because it you know it took me a while to figure it out because not that information not that much information was
is still a mystery and and i i wasn't that interested enough to actually go and understand exactly why but i did document it in this article like here's what i did partly for my own benefit because like if i have to do this again i'm literally never going to be able to understand what to do because it you know it took me a while to figure it out because not that information not that much information was
was out there, bits and pieces on the Rails forums and various blogs. So I thought I'd try and encapsulate it. And it does seem to work because I have had a few people get in touch saying, thank you. Thank you for writing that because I was banging my head against a brick wall trying to figure out how to make it work.
was out there, bits and pieces on the Rails forums and various blogs. So I thought I'd try and encapsulate it. And it does seem to work because I have had a few people get in touch saying, thank you. Thank you for writing that because I was banging my head against a brick wall trying to figure out how to make it work.
So another thing, I suppose, that maybe that Rails could make a little bit easier. Oh, look, it is quite complicated, isn't it? All of this... Direct uploads, if you look at the code in Rails for how that works, it's quite hardcore in my opinion. That's where it came from and how I approach it.
So another thing, I suppose, that maybe that Rails could make a little bit easier. Oh, look, it is quite complicated, isn't it? All of this... Direct uploads, if you look at the code in Rails for how that works, it's quite hardcore in my opinion. That's where it came from and how I approach it.
I mean... The correct thing I should have done, because it was AWS, was to write that as code. Here's a Terraform script that will set up your... I didn't do that. It's probably slightly beyond me, or beyond my patience, I should probably say. I have this patience problem where I'm just impatient. The correct thing would be to study the Terraform and beautifully present this.
I mean... The correct thing I should have done, because it was AWS, was to write that as code. Here's a Terraform script that will set up your... I didn't do that. It's probably slightly beyond me, or beyond my patience, I should probably say. I have this patience problem where I'm just impatient. The correct thing would be to study the Terraform and beautifully present this.
I haven't got time for this. The crazy thing is, of course I have time. I just choose not to. But yeah, I think that could help because then you're expressing in code exactly what you're doing on the cloud front and on the S3 bucket in the case of active storage. But on the Rails side, I mean, there's not that much to do. I mean... With the assets, there's virtually nothing to do.
I haven't got time for this. The crazy thing is, of course I have time. I just choose not to. But yeah, I think that could help because then you're expressing in code exactly what you're doing on the cloud front and on the S3 bucket in the case of active storage. But on the Rails side, I mean, there's not that much to do. I mean... With the assets, there's virtually nothing to do.
You just have to set the asset host. All the configuration is in AWS. Whereas with the active storage, you have to create this direct route. And then with that action text, you have to then go and... find the blob partial, you know, and go and change the route in the blob partial and things like that. But once you've done that, it's kind of straightforward. But it's, yeah, fiddly.
You just have to set the asset host. All the configuration is in AWS. Whereas with the active storage, you have to create this direct route. And then with that action text, you have to then go and... find the blob partial, you know, and go and change the route in the blob partial and things like that. But once you've done that, it's kind of straightforward. But it's, yeah, fiddly.
But I think it's mainly fiddly because of the AWS. And if you could automate all that stuff yourself. But I suppose a good test would be to try it on another CDN, of which I've not done. You know, would it work on DigitalOcean or
But I think it's mainly fiddly because of the AWS. And if you could automate all that stuff yourself. But I suppose a good test would be to try it on another CDN, of which I've not done. You know, would it work on DigitalOcean or
or some other, you know, people have the other image CDNs, image-specific CDNs, and they, especially on the larger side of, if your app is, you know, a big commercial app, you might not use CloudFront at all. You might go for one of these proper image CDNs. I have no idea whether that would be easier or more difficult, but presumably from a Rails point of view, kind of the same.
or some other, you know, people have the other image CDNs, image-specific CDNs, and they, especially on the larger side of, if your app is, you know, a big commercial app, you might not use CloudFront at all. You might go for one of these proper image CDNs. I have no idea whether that would be easier or more difficult, but presumably from a Rails point of view, kind of the same.
You just have to get this route to point to the right thing. So it is...
You just have to get this route to point to the right thing. So it is...
But yeah, the article does... That one is pretty straightforward to do that. You just have to... Once you've set up your CloudFront... instance and set the kind of core stuff then you just set the asset host in your Rails app and it just works it literally just works and you know none of those requests are now hitting your app every time you know
But yeah, the article does... That one is pretty straightforward to do that. You just have to... Once you've set up your CloudFront... instance and set the kind of core stuff then you just set the asset host in your Rails app and it just works it literally just works and you know none of those requests are now hitting your app every time you know