DEV Community

Cover image for How to delete cache from keycloak theme
Ismael Garcia
Ismael Garcia

Posted on

8 1 1 1 1

How to delete cache from keycloak theme

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

view raw socials.md hosted with ❀ by GitHub

Working on the audio version

The Loop VueJs Podcast

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay