# Hot deployment of updated (existing) themes

**URL:** <https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754>\
**Category:** Getting advice\
**Created:** [December 20, 2019, 8:07am UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754 "2019-12-20T08:07:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fschmtt](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@fschmtt](https://forum.keycloak.org/u/fschmtt)\
**Post date:** [December 20, 2019, 8:07am UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/1 "2019-12-20T08:07:57Z")

</div>

[As described in the documentation](https://www.keycloak.org/docs/latest/server_development/#deploying-themes) themes might be “hot deployed” during runtime without downtime.

I have tried this several times and figured out it works perfectly for themes that have not yet been deployed. But when I tried to update an existing theme (having the same name for obvious reasons) it does not override the existing one until I restart Keycloak. Clearing the realm cache also didn’t work.

Am I missing something here?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![stianst](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/stianst/32/16_2.png) [@stianst](https://forum.keycloak.org/u/stianst)\
**Post date:** [December 20, 2019, 9:15am UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/2 "2019-12-20T09:15:29Z")

</div>

Did you try with theme cache disabled? In standalone.xml set cacheThemes and cacheTemplates to false, and also set staticMaxAge to -1.

I did want to at some point have theme caches automatically cleared, and also somehow the resource version updated, but never had time to do it.

---

<div class="post-metadata">

**Author:** ![fschmtt](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@fschmtt](https://forum.keycloak.org/u/fschmtt)\
**Post date:** [December 20, 2019, 9:42am UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/3 "2019-12-20T09:42:46Z")

</div>

Thanks for this tip, didn’t know about that and I (or a colleague) will try this.

Is there a feature request or sth like that already our should we create one?

---

<div class="post-metadata">

**Author:** ![stianst](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/stianst/32/16_2.png) [@stianst](https://forum.keycloak.org/u/stianst)\
**Post date:** [December 20, 2019, 12:16pm UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/4 "2019-12-20T12:16:18Z")

</div>

I think there are some, but don’t have time to look for it right now. Feel free to create a new one, then we’ll figure out if it’s a duplicate when we triage it.

---

<div class="post-metadata">

**Author:** ![gogomarine](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gogomarine/32/1464_2.png) [@gogomarine](https://forum.keycloak.org/u/gogomarine)\
**Post date:** [October 8, 2020, 1:12pm UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/5 "2020-10-08T13:12:16Z")

</div>

keycloak-11.0.2

this issue still exists. theme in system, we deploy new theme file won’t replace or update existing theme. like the cache never gone.

env:

standalone.xml already set

```
<theme>
                <staticMaxAge>-1</staticMaxAge>
                <cacheThemes>false</cacheThemes>
                <cacheTemplates>false</cacheTemplates>
                <dir>${jboss.home.dir}/themes</dir>
</theme>

```

And I start server by command: _./bin/standalone.sh --debug_

Would please tell us where the cache file located? so we can just delete them?  
Thank you.

---

<div class="post-metadata">

**Author:** ![gogomarine](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gogomarine/32/1464_2.png) [@gogomarine](https://forum.keycloak.org/u/gogomarine)\
**Post date:** [October 8, 2020, 2:24pm UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/6 "2020-10-08T14:24:08Z")

</div>

Just figured out. It’s my problem.

My browser cached theme file before I disable cacheTheme, clear the browser cache data will work out. the hot deployment works just fine.

---

<div class="post-metadata">

**Author:** ![ddewaele](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/ddewaele/32/2737_2.png) [@ddewaele](https://forum.keycloak.org/u/ddewaele)\
**Post date:** [April 8, 2021, 1:14pm UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/7 "2021-04-08T13:14:52Z")

</div>

How would this work in a production environment where

- you do not want to disable the cache template
- but you are planning to update your theme

I understand that during development it’s easy to disable the cache, but I assume that in a production environment there should be a way to invalidate the theme cache for a certain realm without restarting the entire keycloak service ?

---

<div class="post-metadata">

**Author:** ![retendo](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/retendo/32/3062_2.png) [@retendo](https://forum.keycloak.org/u/retendo)\
**Post date:** [May 5, 2021, 1:16pm UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/8 "2021-05-05T13:16:02Z")

</div>

I second this question. This seems like a very common use-case. How should we do that?

---

<div class="post-metadata">

**Author:** ![jens1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jens1](https://forum.keycloak.org/u/jens1)\
**Post date:** [May 31, 2021, 4:16pm UTC](https://forum.keycloak.org/t/hot-deployment-of-updated-existing-themes/754/9 "2021-05-31T16:16:04Z")

</div>

I have investigated the issue in [Old theme resources are loaded even after restart due to theme caching](http://forum.keycloak.org/t/old-theme-resources-are-loaded-even-after-restart-due-to-theme-caching/8413) and reported a bug ticket.

For now, I remove my Docker-container and create a new one after a hot deployment of the updated theme (my standalone volume is mounted). However, this kills the added value of the hot deployment feature.
