# Does discourse have a cache?

**URL:** https://meta.discourse.org/t/does-discourse-have-a-cache/112698
**Category:** Support
**Created:** [March 27, 2019, 1:08pm UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698 "2019-03-27T13:08:43Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Tungki\_Reza\_Prasakti](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tungki\_Reza\_Prasakti](https://meta.discourse.org/u/Tungki_Reza_Prasakti)
#### Post date: [March 27, 2019, 1:08pm UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/1 "2019-03-27T13:08:43Z")

</div>

I’m not sure if discourse had cache or not, i’ve tried using [loader.io](http://loader.io) to test my forum and it as fast as using cache but i can’t find cache software through wappalyzer, so what cache does discourse use? does it built in cache? and does it possible to add third party cache?

---

<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: [March 28, 2019, 12:20am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/2 "2019-03-28T00:20:29Z")

</div>

What do you mean by “cache”? Discourse benefits from use of a CDN, for the standard reasons – shared web / JS assets that don’t change much can be cached either on the user’s device, or by a local CDN node geographically closer to the user.

---

<div class="post-metadata">

### Author: ![Tungki\_Reza\_Prasakti](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tungki\_Reza\_Prasakti](https://meta.discourse.org/u/Tungki_Reza_Prasakti)
#### Post date: [March 28, 2019, 12:40am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/3 "2019-03-28T00:40:18Z")

</div>

What i mean by cache is just like ‘Varnish cache’ that installed on a website. does discourae has built it cache like that?

> [@codinghorror](#):
>
> Discourse benefits from use of a CDN, for the standard reasons

Oh so all our asset on forum are being hosted on cdn not on our local host?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [March 28, 2019, 2:43am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/4 "2019-03-28T02:43:59Z")

</div>

No, because Discourse is for the most part serving dynamic content. Varnish as in in-memory cache of _static_ content makes no sense here.

> [@Tungki\_Reza\_Prasakti](#):
>
> Oh so all our asset on forum are being hosted on cdn not on our local host?

That depends, if you’re self-hosting have you configured one?

---

<div class="post-metadata">

### Author: ![Tungki\_Reza\_Prasakti](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tungki\_Reza\_Prasakti](https://meta.discourse.org/u/Tungki_Reza_Prasakti)
#### Post date: [March 28, 2019, 2:54am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/5 "2019-03-28T02:54:27Z")

</div>

> [@Stephen](#):
>
> No, because Discourse is for the most part serving dynamic content. Varnish as in in-memory cache of _static_ content makes no sense here.

are you sure? stackoverflow using varnish, and almost every minute there a question

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [March 28, 2019, 2:54am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/6 "2019-03-28T02:54:53Z")

</div>

Yep, very. There’s nothing for Varnish to accelerate.

Stop thinking about Discourse as a website and start viewing it as an application. The use cases are _very_ different.

---

<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: [March 28, 2019, 3:01am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/7 "2019-03-28T03:01:15Z")

</div>

Discourse is a Javascript app that runs in the browser. It is not static HTML and CSS. It is a ball of JS code that is delivered to the browser, which then executes that code.

View your F12 network tab in the browser if you don’t believe me. Watch the requests that come through.

---

<div class="post-metadata">

### Author: ![Tungki\_Reza\_Prasakti](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tungki\_Reza\_Prasakti](https://meta.discourse.org/u/Tungki_Reza_Prasakti)
#### Post date: [March 28, 2019, 3:14am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/8 "2019-03-28T03:14:34Z")

</div>

ah so discourse its very lightweight, that doesnt even need cache, right?

im just curious that im using plain wordpress on same vps and “brute force” my site, the success rate is about 8% but when using discourse its all request are received just like using cache on my wordpress

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [March 28, 2019, 3:23am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/9 "2019-03-28T03:23:12Z")

</div>

WordPress is designed to serve a high volume of pages with little to no change to a high volume of users. Write **little** , read **lots** which requires **little** resources to do.

You can use plugins to build gzipped static copies of pages, database queries can be cached in-memory and the whole site can be front-ended with a product such as Varnish.

Most Wordpress sites serve the majority of their sessions to logged-out users.

Discourse on the other hand serves views tailored to the individual. The majority of the users are logged in. Write **frequently** , read **frequently** which comparatively requires **lots** of resources.

There’s really no comparison.

Your test is based on a flawed premise, particularly when you consider this:

> **Do you load linked resources/assets?**  
> No. Our load generators only know about the URLs you give us when you create a test. We don’t parse the HTML and we don’t download javascript, CSS, or images linked to within pages.

Their test doesn’t even load Discourse correctly.

Source: [Loader.io](https://support.loader.io/article/39-do-you-load-linked-resources-assets)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 28, 2019, 5:10am UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/10 "2019-03-28T05:10:50Z")

</div>

Also, yes, Discourse does have a cache of full page responses - for logged-out (anonymous) users, which it sounds like this “load test” is doing.

The Discourse team has also benchmarks that directly exercise the known-expensive code in the critical serving paths, you can find them if you search around on here.

---

<div class="post-metadata">

### Author: ![Tungki\_Reza\_Prasakti](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tungki\_Reza\_Prasakti](https://meta.discourse.org/u/Tungki_Reza_Prasakti)
#### Post date: [March 28, 2019, 12:45pm UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/11 "2019-03-28T12:45:00Z")

</div>

Please sum it up, does discourse have cache on their engine? that’s the only answers i need.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [March 28, 2019, 5:52pm UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/12 "2019-03-28T17:52:57Z")

</div>

This?

[GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. · GitHub](https://github.com/discourse/discourse)

> … We use Redis as a cache and for transient data. …

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 27, 2019, 5:53pm UTC](https://meta.discourse.org/t/does-discourse-have-a-cache/112698/13 "2019-04-27T17:53:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
