โšกPerformance optimization

Enable loading in a blink of an eye of login pages with --external-assets

By default when your users reach the login pages all scripts, images and stylesheet are downloaded from the Keycloak server. If you are specifically building a theme to integrate with an app or a website that allows users to browse unauthenticated before logging in, you will get a significant performance boost if you jump through those hoops:

  • Provide the url of your app in the homepage field of package.json. ex or in a public/CNAME file. ex.

  • Build the theme using npx build-keycloak-theme --external-assets ex

  • Make sure not to build your app and the keycloak theme separately (run yarn keycloak only once in your CI) and remember to update the Keycloak theme every time you update your app.

  • Be mindful that if your app is down your login pages are down as well.

Checkout a complete setup here

Last updated

Was this helpful?