英文:
How to disable theme caching in keycloak 20
问题
我在Docker中运行Keycloak 20.0.3,设置为KC_CACHE: ispn
我有几个登录页面的主题。如何禁用和清除主题缓存?较新版本的Keycloak没有standalone_ha.xml
英文:
I am running keycloak 20.0.3 in docker with setting KC_CACHE: ispn
I have a few themes for the login page. How can I disable and clear theme caching ? Newer version of keycloak does not have standalone_ha.xml
答案1
得分: 1
如果您以开发模式启动Keycloak,主题缓存应该会自动停用。
使用以下命令:
podman|docker run --name mykeycloak -p 8080:8080 \
-e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=change_me \
quay.io/keycloak/keycloak:latest \
start-dev
(来源: https://www.keycloak.org/server/containers)
如果不起作用,请将以下参数添加到启动脚本中:
bin/kc.[sh|bat] start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false
(来源: https://www.keycloak.org/docs/latest/server_development/#creating-a-theme)
我从docker-compose中这样启动它:
entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev",
# 在主题开发期间停用主题缓存
"--spi-theme-static-max-age=-1",
"--spi-theme-cache-themes=false",
"--spi-theme-cache-templates=false"
# ...
]
英文:
If you start keycloak in development mode theme caching should be deactivated automatically.
Call:
podman|docker run --name mykeycloak -p 8080:8080 \
-e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=change_me \
quay.io/keycloak/keycloak:latest \
start-dev
(from: https://www.keycloak.org/server/containers)
If it doesn't work add the following params to the startup script:
bin/kc.[sh|bat] start --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false
(from: https://www.keycloak.org/docs/latest/server_development/#creating-a-theme)
I start it from docker-compose like this:
entrypoint: [ "/opt/keycloak/bin/kc.sh", "start-dev",
# deactivate theme caching during theme development
"--spi-theme-static-max-age=-1",
"--spi-theme-cache-themes=false",
"--spi-theme-cache-templates=false"
# ...
]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论