Heavy caching when customising - any way to bypass?

AI-generated summary

User dylandamsma reported severe caching issues while customizing the styling on a Discourse instance hosted on a 1GB DigitalOcean server. Despite clearing the cache, rebuilding the application, and testing across different browsers, changes to the CSS took up to a day to reflect, and the preview function displayed outdated styles. riking suggested a workflow of editing, saving, and previewing, while sam noted that similar bugs had been recently addressed in newer versions. After providing a code snippet for footer styling that failed to apply, dylandamsma discovered the root cause: the site was behind Cloudflare, which was aggressively caching the static assets. The issue was resolved by bypassing Cloudflare and accessing the site directly via its IP address, confirming that the problem lay with the external CDN rather than Discourse itself.

Hi there,

This is my first post, tried to find an answer to this question, but couldn’t find it.

I am running a discourse install on a 1GB DO server and currently trying to edit our styling.

The caching however is so heavy, that it can take up to a day to show any changes. I tried:

  • Clearing cache (no result)
  • Using other browsers (no result)
  • Update: tried rebuilding; no result.
  • I only have 1 style enabled. (see screenshot)

Previewing styling gives an older version as well and even removes some of the styling.. I am lost.
I checked whether I am targeting the right elements, and I am 100% sure they are correct.

Is there any way I can solve this or bypass the caching when editing the styling?

Best,
Dylan

That’s strange, for me preview style always is up to what I just changed. To be clear, what I would do is make edits → save → preview → check changes → use inspector to make more changes → copy into editor → repeat.

1 „Gefällt mir“

I recall this being quite buggy and recall improving this quite a lot recently, it it working correctly on latest?

Update: Solved, see next post

Hi Sam,

Sorry my reply took a while. I’ve been working on the forum here:
http://community.autopilothq.com

Today, I added this part of CSS:

// Footer styling

#footer {
    width: 100%;
    background: #fff;
    padding: 30px 0;
}
#footer.container {
    position: relative;
    padding: 0 10px;
    margin: 0 auto;
    max-width: 1240px;
}
.footer-nav {
    float: right;
    display: inline-block;
    line-height: 18px;
}
.footer-nav li {
    display: inline-block;
    padding: 0 12px;
}
.copyright-block {
    float: left;
}

However, these changes (despite being enabled and saved) do not show in the customised style sheet:
http://community.autopilothq.com/site_customizations/7e202ef2-56d7-47d5-98d8-a9c8d15e57dd.css?target=desktop&v=59e7baf3d90ecba3cfbc855685f7caba&__ws=community.autopilothq.com

I’ve tried refreshing, clearing cache, other browsers.. nothing helps to get it working.

Is it possible to clear the cache or something to get the changes through? it’s really annoying not being able to see the changes when making style changes to the site. (also, it would be nice if that footer on the site is styled :stuck_out_tongue: )

Alright…

This is solved.

Stupid mistake on my side. The site is behind cloudflare and was getting cached by cloudflare.

Viewing the website directly using the IP address “solves” the issue.

3 „Gefällt mir“