[keycloak-dev] Improve browser caching?

Stian Thorgersen stian at redhat.com
Wed Feb 4 07:22:29 EST 2015



----- Original Message -----
> From: "Pedro Igor Silva" <psilva at redhat.com>
> To: "Stian Thorgersen" <stian at redhat.com>
> Cc: "Marek Posolda" <mposolda at redhat.com>, keycloak-dev at lists.jboss.org
> Sent: Wednesday, 4 February, 2015 1:18:17 PM
> Subject: Re: [keycloak-dev] Improve browser caching?
> 
> ----- Original Message -----
> > From: "Stian Thorgersen" <stian at redhat.com>
> > To: "Pedro Igor Silva" <psilva at redhat.com>
> > Cc: "Marek Posolda" <mposolda at redhat.com>, keycloak-dev at lists.jboss.org
> > Sent: Wednesday, February 4, 2015 5:55:40 AM
> > Subject: Re: [keycloak-dev] Improve browser caching?
> > 
> > 
> > 
> > ----- Original Message -----
> > > From: "Pedro Igor Silva" <psilva at redhat.com>
> > > To: "Marek Posolda" <mposolda at redhat.com>
> > > Cc: keycloak-dev at lists.jboss.org
> > > Sent: Tuesday, 3 February, 2015 11:07:11 PM
> > > Subject: Re: [keycloak-dev] Improve browser caching?
> > > 
> > > What about have something that intercept requests to disable browser
> > > caching
> > > ? A servlet filter or something ...
> > 
> > We actively enable browsing caching to increase performance, so not sure
> > why
> > we would want a filter to disable it?
> 
> Actually, manage caching. So you can control how http caching is set in
> responses. If you want to disable, you just change a config. Or if you want
> to set a default expiration time for pages or specific resources.

We already manage caching though. We set max-age to allow browsers to cache resources that are not dynamic. We could use etags, but that still requires a request to the server. So the only decent solution I can think of is making sure we have a unique url, which we can do by adding a version/hash or something.

> 
> > 
> > > 
> > > ----- Original Message -----
> > > From: "Marek Posolda" <mposolda at redhat.com>
> > > To: keycloak-dev at lists.jboss.org
> > > Sent: Tuesday, February 3, 2015 8:00:07 PM
> > > Subject: [keycloak-dev] Improve browser caching?
> > > 
> > > We seem to have many questions each release related to non-working
> > > things due to stale browser cache. Usually it's due to changes in admin
> > > console, but it may be even worse if we ever change something in CSS/JS
> > > of login or account mgmt, as those are available for end users.
> > > 
> > > I wonder if we can somehow improve this? One possible solution is to
> > > attach the redundant parameter with version to the cached resources.
> > > Something like: "/auth/theme/.../stylesheet.css?v=1.1.0.Final", so
> > > upgrade to next version will force browser to reload the resource.
> > > 
> > > The problem is longer (and not so nice) URLs and also some refactoring
> > > needed. For freemarker templates, we can add version parameter at
> > > runtime. However for admin console HTML pages, we would need to add
> > > version somehow at compile time though.
> > > 
> > > There is also possibility to attach hash instead of version (Juca
> > > mentioned this to me some time ago), but not sure if it's big difference.
> > > 
> > > Any better ideas? Or should we rather just keep it as it is?
> > > 
> > > Marek
> > > _______________________________________________
> > > keycloak-dev mailing list
> > > keycloak-dev at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/keycloak-dev
> > > _______________________________________________
> > > keycloak-dev mailing list
> > > keycloak-dev at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/keycloak-dev
> > > 
> > 
> 


More information about the keycloak-dev mailing list