# Enable a CDN for your Discourse

**URL:** https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857
**Category:** Self-Hosting
**Tags:** cdn, configuring, how-to
**Created:** [4월 18, 2014, 7:51오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857 "2014-04-18T07:51:41Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [1월 17, 2017, 3:50오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/59 "2017-01-17T15:50:12Z")

</div>

hmm, can you resolve avatars from your host (or container)

---

<div class="post-metadata">

### Author: ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)
#### Post date: [1월 19, 2017, 1:15오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/60 "2017-01-19T01:15:59Z")

</div>

Do you recommend MaxCDN? I am already their customer so it would be nice to keep things in a place.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [1월 19, 2017, 1:37오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/61 "2017-01-19T01:37:17Z")

</div>

Sure, we use them for some of our sites, reliable CDN

---

<div class="post-metadata">

### Author: ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)
#### Post date: [1월 22, 2017, 3:34오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/62 "2017-01-22T03:34:58Z")

</div>

> [@sam](#):
>
> Sure, we use them for some of our sites, reliable CDN

One question. if my discourse website uses SSL, then CDN must use SSL too right?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [1월 23, 2017, 3:18오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/63 "2017-01-23T15:18:59Z")

</div>

Yes, that is correct, most CDNs give you an ssl endpoint for free

---

<div class="post-metadata">

### Author: ![8BIT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/8bit/32/76872_2.png) [@8BIT](https://meta.discourse.org/u/8BIT)
#### Post date: [9월 2, 2017, 5:02오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/65 "2017-09-02T05:02:21Z")

</div>

@codinghorror - I see you recommend Fastly… that was a few years ago. This still the case now?

_edit_ - also, they’ve overhauled their onboarding significantly to look like this:

> **view big image**
>
> ![Fastly Onboarding](https://global.discourse-cdn.com/meta/original/3X/7/7/77978337bfdf9e4aca356ae1f3d0465984a49b16.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9월 2, 2017, 6:56오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/66 "2017-09-02T06:56:20Z")

</div>

Fastly is solid, you should shop around and see what prices and service you are interested in. The usual way all CDNs charge is per gigabyte per region (north america, europe, etc).

---

<div class="post-metadata">

### Author: ![dfriestedt](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dfriestedt](https://meta.discourse.org/u/dfriestedt)
#### Post date: [11월 18, 2017, 10:39오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/67 "2017-11-18T22:39:59Z")

</div>

I’m trying to setup Fastly for my CDN.

Here is my setup:

Domain: discuss.endurancelab.fit  
Address: IP Address of Host at Amazon  
SNI Hostname: discuss.endurancelab.fit  
TLS CA: I’m using Let’s Encrypt (installed at setup)

Fastly accepts all the settings and instructs me to add a CNAME. [Working with CNAME records and your DNS provider | Fastly Documentation](https://docs.fastly.com/guides/basic-setup/adding-cname-records)

At this point I’m a little confused. what DNS entry do I make? I can’t create a CNAME for discuss.endurancelab.fit to [global.prod.fastly.net](http://global.prod.fastly.net) because of the MX and TXT entries on that domain.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11월 18, 2017, 11:02오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/68 "2017-11-18T23:02:19Z")

</div>

The cdn would be at its own name like

`discuss-cdn.endurancelab.fit`

---

<div class="post-metadata">

### Author: ![dfriestedt](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dfriestedt](https://meta.discourse.org/u/dfriestedt)
#### Post date: [11월 18, 2017, 11:11오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/69 "2017-11-18T23:11:45Z")

</div>

I thought traffic routes through fastly to the host? So don’t I need to point the domain name discuss.endurancelab.fit to [global.prod.fastly.net](http://global.prod.fastly.net) which then routes traffic to the IP address of the host?

Also, from the Fastly website: “When using free TLS, you cannot DNS alias your own domain ([www.example.org](http://www.example.org)) to the shared domain ([example.global.ssl.fastly.net](http://example.global.ssl.fastly.net)). If you do, a TLS name mismatch warning will appear in the browser. The only way to avoid the mismatch error is to order a paid TLS option.”

Sorry, I’m sure this is a stupid question but I’ve literally spent about 4 hours reading the fastly docs and I’m stuck.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11월 19, 2017, 1:08오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/70 "2017-11-19T01:08:47Z")

</div>

I don’t recommend routing all your traffic through there, ala Cloudflare. I am describing a traditional CDN, where only the static assets (css, js, etc) are delivered via CDN nodes close geographically to the user.

Does fastly no longer offer traditional CDN services?

---

<div class="post-metadata">

### Author: ![dfriestedt](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dfriestedt](https://meta.discourse.org/u/dfriestedt)
#### Post date: [11월 19, 2017, 1:11오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/71 "2017-11-19T01:11:09Z")

</div>

Yes - they do deliver traditional CDN. I was hoping to test out dynamic content acceleration. But if you don’t recommend that, I won’t try it.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11월 19, 2017, 1:13오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/72 "2017-11-19T01:13:16Z")

</div>

It is a way more complex setup for arguably _negative_ benefit. We are a JavaScript app not a set of 1996 era old school HTML web pages 😉

---

<div class="post-metadata">

### Author: ![Anil\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@Anil\_Gupta](https://meta.discourse.org/u/Anil_Gupta)
#### Post date: [12월 26, 2017, 4:15오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/73 "2017-12-26T16:15:39Z")

</div>

We have deployed Discourse on Google Compute Engine and looking to use Google Cloud CDN via Google Cloud Load balancer.  
The load balancer automatically caches content (or any file) that has the cache-control header set. There are no separate origins needed.

1. Is there a way we can set the cache-control headers for static assets?
2. Do we have any example where someone would have achieved caching with Google Load Balancer?

I would appreciate any help here.

**Update: 30 Dec 2017.**  
I found out that my discourse install is actually setting the ‘Cache-control’ header automatically for static assets like images and JS files. This certainly helps me use the Google CDN with no changes what-so-ever. Wow 🙂

Earlier, i was not able to see it because we were running the ‘Bitnami Discourse image’. I think their image carries the development version of Discourse and hence, the headers are NOT set automatically.

I am happy that I moved to [Official install](https://meta.discourse.org/t/142537?silent=true)!  
Thanks guys.

Our Discourse installation:

> **[Home TruVisa](https://www.truvisa.com)**
>
> Innovating Software Solutions for Banking and Healthcare. Managed Services, Modern Web Applications, Cloud Solutions, and Legacy System Support.

---

<div class="post-metadata">

### Author: ![Blinq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blinq/32/98523_2.png) [@Blinq](https://meta.discourse.org/u/Blinq)
#### Post date: [5월 31, 2018, 5:08오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/75 "2018-05-31T05:08:13Z")

</div>

I see Discourse recommends Fastly, but what about Cloudflare CDN? That is arguably the best CDN in the world.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 31, 2018, 5:16오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/76 "2018-05-31T05:16:43Z")

</div>

Cloudflare isn’t a traditional CDN, more like a global man-in-the-middle service.

---

<div class="post-metadata">

### Author: ![Blinq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blinq/32/98523_2.png) [@Blinq](https://meta.discourse.org/u/Blinq)
#### Post date: [5월 31, 2018, 5:19오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/77 "2018-05-31T05:19:25Z")

</div>

Well why wouldn’t you recommend Cloudflare for Discourse?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 31, 2018, 5:20오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/78 "2018-05-31T05:20:24Z")

</div>

Do a search and see for yourself [https://meta.discourse.org/search?q=cloudflare%20broken](https://meta.discourse.org/search?q=cloudflare%20broken)

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [5월 7, 2021, 11:09오후 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/79 "2021-05-07T23:09:14Z")

</div>

안녕하세요,

죄송하지만 그 부분이 이해가 되지 않습니다.

Discourse가 새 파일(이미지, 업데이트된 JS 등)을 제 CDN 제공업체로 전송하는 방식이 궁금합니다. AWS CloudFront의 경우, CloudFront에 사용 중인 S3 버킷으로 어떻게 전송되는지 알려주시면 감사하겠습니다.

감사합니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [5월 8, 2021, 12:14오전 UTC](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857/80 "2021-05-08T00:14:33Z")

</div>

CDN은 요청을 받았고 아직 캐시에 저장되지 않은 경우 해당 리소스를 요청합니다.

어떤 CDN을 설정하든 작동 방식은 이렇습니다. `Bunny.net`은 설정이 쉽습니다.

[이전 페이지](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857.md?page=1)

[다음 페이지](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857.md?page=3)
