How do custom emoji URLs work?

So after reporting this: Custom emoji don't use CDN for S3 stored assets in a few pages - #6 by Falco and finding out after a bit of research what I think to be a missing feature / bug in discourse: Custom emoji don't use CDN for S3 stored assets in a few pages - #8 by Boost
I tried writing code that would map the custom emoji URLs to the S3_CDN URL: https://github.com/discourse/discourse/compare/master...hhyyrylainen:custom_emoji_cdn_url?expand=1

Which I also tested with rails console and it seems the logic is right, however when I tried deploying that change to my production site, it didn’t seem like it actually did anything at all (not even the emoji version change caused the standard emoji to update URLs).

So what I’m trying to ask is how this whole emoji caching and URL sending to the client works? Where could I hook in there to make this fix work?

1 Like