# Stylesheet cache in multi-server setup

**URL:** <https://meta.discourse.org/t/stylesheet-cache-in-multi-server-setup/24820>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [2015 年 2 月 4 日午後 8:41 UTC](https://meta.discourse.org/t/stylesheet-cache-in-multi-server-setup/24820 "2015-02-04T20:41:41Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![harto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harto/32/38551_2.png) [@harto](https://meta.discourse.org/u/harto)\
**Post date:** [2015 年 2 月 4 日午後 8:41 UTC](https://meta.discourse.org/t/stylesheet-cache-in-multi-server-setup/24820/1 "2015-02-04T20:41:41Z")

</div>

Hello,

We’re running Discourse using AWS Elastic Beanstalk’s Docker environment, with a single Docker container running on each of 2 (or more) servers.

We noticed that the main stylesheet is 404ing about 50% of the time. I think this is because of the stylesheet cache implementation:

- A rebuild of the main stylesheet is triggered by e.g. adding a new category.
- One of the servers recompiles the stylesheet, writes it to its local filesystem, and updates the stylesheet path in the distributed cache.
- Both servers now serve the updated stylesheet path, but only one of the servers has the updated stylesheet in its filesystem.

Is my understanding of the issue correct? If so, it seems like this could potentially be solved by writing the stylesheet to the distributed cache, or a shared storage service like S3, rather than the local filesystem.

---

_[View the full topic](https://meta.discourse.org/t/stylesheet-cache-in-multi-server-setup/24820)._
