How to delete cache from keycloak theme
Ismael Garcia

Ismael Garcia @leamsigc

About: Always ask questions to feed the curiosity and learn something new on the way. El respeto al derecho ajeno es la paz. Benito Juarez Garcia.

Location:
Wetzlar,Germany
Joined:
Dec 15, 2017

How to delete cache from keycloak theme

Publish Date: Jun 21 '24
13 0

Developing a new theme for keycloak sometimes is hard if you have to clear the cache on every single change.

When working or developing a new keycloak theme it is better to set the configuration for the keycloak cache to false, that way every rebuild of the keycloak your changes are reflected right a way

For older version of keycloak the solution was to update the standalone.xml
then updating the theme tag

<theme>
    <staticMaxAge>-1</staticMaxAge>
    <cacheThemes>false</cacheThemes>
    <cacheTemplates>false</cacheTemplates>
    ...
</theme>
Enter fullscreen mode Exit fullscreen mode

But with the latest version of keycloak this doesn’t work anymore because there is not a standalone.xml but the solution is the following:

bin/kc.[sh|bat] start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false
Enter fullscreen mode Exit fullscreen mode

This is the important part, the arguments for the keycloak

--spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false

The other solution is to do delete the cache manually by:

Delete the content of the themes cache, you can do so by deleting the data/tmp/kc-gzip-cache directory of the server distribution.

Not related:

nuxt-monorepo-layers

Please if anyone have a better way please comment below and let's learn together

Working on the audio version

The Loop VueJs Podcast

Comments 0 total

    Add comment