DEV Community

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

Posted on

7 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 Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

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

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay