Repository navigation
Replies: 5 comments 3 replies
|
As i see in the code, it seems that there are:
@stianst might have a clue about this issue, since as i see he probably implemented the whole keycloak-side theme caching. It would be great if i could get a clue about the keycloak theme's cache lifecycle:
|
|
The proper solution to this is most likely to generate a new resource version either automatically if themes have changed, or have a way to specify the resource version. That would result in new URLs for everything, which moves around the browser caching issue. A better, but more complicated approach would be to have separate resource version for Keycloak built-in stuff, and custom themes, or even go further than that. I'd probably at least initially just do one version for everything, that perhaps separate KC stuff from custom stuff. |
|
I found the cache. There are lots of GZ files there, you just need to delete them for cache to be cleared. The funny thing is that you don't even need to edit configuration or restart anything. Just edit your theme file, delete the GZ and you're ready to go. |
|
FYI. For the Quarkus (19.0.1) version this cache directory is I had to manually delete this directory after new theme provider jar version deployment. Until then the CSS files remained from the old jar version (although the template changes were ok without the manual data/tmp directory cleaning 🤔). |
|
how can i make reload ftl files ? i have edited some ftl files and cleared the cache at mentioned location but this didnt reflect to keycloak. However on server restart changes appear on Keycloak. Does keycloak has a different caching mechanism for ftl.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello everybody.
We have a custom theme which is packed as a jar and imported as a module (under keycloak modules folder).
Whenever we have some updates in the theme code, we want to be able to redeploy our theme on an existing keycloak deployment, without having the cache disabled.
Our theme apart from the static files (js, html, ftl, css, etc} also includes an SPI (java code) to allow fetching some extra data from the keycloak.
We could hot deploy the jar (which extracts all the jar elements in a new folder) as described in the documentation, but in this case, it doesn't load the SPI(s) at all.
If we replace the jar in the modules folder and restart, it does not refresh the cached theme (js, html, etc).
Currently, we need to always have the theme caching disabled, which is something we do not prefer.
I cannot find any way to have this type of module redeployed without disabling the cache, maybe i am missing something in the documentation.
A dirty hack would be to do (run) something which would clear all cached themes, if such a thing is possible.
Does anyone have a clue on that?
All reactions