[keycloak-user] Theme Resources Urls

Doug Szeto DSzeto at investlab.com
Tue Dec 1 07:21:43 EST 2015


If you want to bust the cache on a version update, a better practice is to stick the version id as a query parameter at the end of resources, see:
https://css-tricks.com/strategies-for-cache-busting-css/

ie http://localhost:8080/auth/resources/themes/login/keycloak/css/login.css?v=1.6.1.final

I thought the point of customized themes were to allow developers better control over the web resources being served without modifying the security source code. But if we can't control the url of our content, it limits our options on web optimization strategies.

I guess overriding the freemaker template is the only way to go.

--Doug

________________________________________
From: keycloak-user-bounces at lists.jboss.org <keycloak-user-bounces at lists.jboss.org> on behalf of Bill Burke <bburke at redhat.com>
Sent: Monday, November 30, 2015 23:07
To: keycloak-user at lists.jboss.org
Subject: Re: [keycloak-user] Theme Resources Urls

Browser caching is turned on for themed resources (admin console,
login, etc.)  This is obviously for performance reasons.

IN the past we received a HUGE amount of false bug reports of "Admin
console doesn't work", "my theme changes aren't showing", etc. after
upgrading Keycloak.  All because people didn't clear their browser
caches.  Hence, the version id.

You should not be externally linking to themed endpoints.  You can use a
different URL to ping the server for "is alive" i.e.
/<root>/realms/{realm-name}


On 11/30/2015 9:56 AM, Doug Szeto wrote:
> What do you mean by 'You can't customize the url format'?
>
> Is there a design decision reason why it is more secure to have your
> keycloak version exposed in the middle of your theme resource urls?
>
> Or would it be easier if you had a pull request?
>
> --Doug
>
>
>
> ------------------------------------------------------------------------
> *From:* Stian Thorgersen <sthorger at redhat.com>
> *Sent:* Monday, November 30, 2015 15:35
> *To:* Doug Szeto
> *Cc:* keycloak-user at lists.jboss.org
> *Subject:* Re: [keycloak-user] Theme Resources Urls
> You can't customize the url format. Not sure how it would help during
> upgrades? I'd say the opposite as you end up with cached versions for
> the old release not being updated.
>
> On 28 November 2015 at 03:54, Doug Szeto <DSzeto at investlab.com
> <mailto:DSzeto at investlab.com>> wrote:
>
>
>     Hi,
>     I have created a custom theme as specific in your docs here:
>     http://keycloak.github.io/docs/userguide/keycloak-server/html/themes.html
>     It functions in the browser, in that these configs tell you where
>     the theme customization resources are stored locally, but the end
>     result is the resources are served from the url format pattern of:
>
>     http://localhost:8080/auth/resources/1.6.1.final/login/keycloak/css/login.css
>
>     Is there a way to customize the theme url format to scrub the
>     version number off the css/image/js resources? This will help out in
>     monitoring and upgrades.
>
>     Thanks,
>     --Doug
>     _______________________________________________
>     keycloak-user mailing list
>     keycloak-user at lists.jboss.org <mailto:keycloak-user at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>

--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list