# Problem with custom login page

**URL:** <https://forum.keycloak.org/t/problem-with-custom-login-page/7889>\
**Category:** Extending the server\
**Created:** [March 11, 2021, 4:24pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889 "2021-03-11T16:24:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![emartinezr](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@emartinezr](https://forum.keycloak.org/u/emartinezr)\
**Post date:** [March 11, 2021, 4:24pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889/1 "2021-03-11T16:24:45Z")

</div>

Hello,

this is my first message.

I have Keycloak 12.0.3 running in a standalone mode. I’m following this guide [Server Developer Guide](https://www.keycloak.org/docs/latest/server_development/#creating-a-theme) to customize the login page. I created the folder and activated it in the admin page (custom theme). While having these options active in standalone.xml everything works fine

```auto
<staticMaxAge>-1</staticMaxAge>
<cacheThemes>false</cacheThemes>
<cacheTemplates>false</cacheTemplates>

```

But the guide also says that when you’re done customizing you should re-enable the cache for performance, but when I do that using the default values

```auto
<staticMaxAge>2592000</staticMaxAge>
<cacheThemes>true</cacheThemes>
<cacheTemplates>true</cacheTemplates>

```

I no longer see the modifications I made. I’ve tried cleaning the cache of every browser I tried (FF, Brave, Chrome, etc), activating the `Disable cache` checkbox in the Dev tools windows and I keep getting the cached templates, the base ones. I only see the messages I created under /messages/messages\_en.properties, so I know that the theme was created correctly.

Is there something else I should clean? Is it really a big issue to have cache disabled when I only have the login page customized? It’s also for internal use so there are not too many people accesing the page.

Thanks in advance. If you need more info just let me know.

Eric,

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [March 11, 2021, 6:58pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889/2 "2021-03-11T18:58:32Z")

</div>

When you set `cacheThemes` and `cacheTemplates` back to true, it will no longer reload them (internally). This is not a dev tools or browser thing. The server either caches the templates or reloads them. If you want to make modifications, and have them picked up, either set `cacheThemes` and `cacheTemplates` back to false, or restart the server.

If you don’t have much traffic, it shouldn’t be a problem to have it set to false.

---

<div class="post-metadata">

**Author:** ![emartinezr](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@emartinezr](https://forum.keycloak.org/u/emartinezr)\
**Post date:** [March 11, 2021, 7:48pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889/3 "2021-03-11T19:48:06Z")

</div>

@xgp Thank you for your answer, but I’m a little bit confused with this statement

> If you want to make modifications, and have them picked up, either set `cacheThemes` and `cacheTemplates` back to true

Afaik that’s what I did, first I set it to false and when I was done customizing I set those back to true again. But that didn’t work.

By restart the server I understand shutting down the process and start it over again. That’s what I do after I made changes, I’m not aware of any command to reload the server. But still, that didn’t work either.

I’m planning to let them as false since it’s the only option that worked for me.

Thanks again, I really appreciate your answer!

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [March 11, 2021, 7:56pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889/4 "2021-03-11T19:56:09Z")

</div>

Sorry. I meant “back to false”.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [March 11, 2021, 7:57pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889/5 "2021-03-11T19:57:13Z")

</div>

Not sure why it didn’t pick up your changes after a server restart. Regardless of the `cacheThemes` and `cacheTemplates` values, it should pick up changes.

---

<div class="post-metadata">

**Author:** ![emartinezr](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@emartinezr](https://forum.keycloak.org/u/emartinezr)\
**Post date:** [March 11, 2021, 9:47pm UTC](https://forum.keycloak.org/t/problem-with-custom-login-page/7889/6 "2021-03-11T21:47:24Z")

</div>

Ok, good news. The guide says as follows

> Themes can be deployed to Keycloak by copying the theme directory to `themes` or it can be deployed as an archive

This wasn’t true in my case. If I put the folder under `themes` keycloak recognizes it but it doesn’t apply it (with cache turned on; with cache turned off it works).

So I kept reading and I tried what it’s suggested under [Server Developer Guide](https://www.keycloak.org/docs/latest/server_development/#deploying-themes). I created a jar file, moved it to `/standalone/deployments`, keycloak saw it immediatly, I selected it in the admin console and it was applied immediatly with cache turned on.

I think the guide is a little bit misleading. In any case it worked.

Thanks for your help!
