You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Davids Patrick <P....@healthag.de> on 2016/06/07 14:57:19 UTC
Conditional (static) dynamic resources / ;-)
Hi all,
I have a quite tricky usecase here and I don't know how to handle that.
Our system allows to upload user pictures to profiles.
So, when the user profile picture is displayed it is read from database and delivered by DynamicImageResource.
If the user did not upload any pictures yet an fallback image is delivered (generic male and female).
To have them cached/static I thought I can handle this by setting the lastModified flag, but in my case I revoke the behavior, because I am in a refreshing view which re-creates my components, due to that also a new DynamicImageResource is created and my lastModified date information is lost.
What could be the best practice to achieve a "conditional caching" for (Dynamic)ImageResources?
Kind regards
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
AW: Conditional (static) dynamic resources / ;-)
Posted by Davids Patrick <P....@healthag.de>.
Hi Martin,
ok... working... but not as expected.
My urls are stable and cachable.
But I dont know, what I do wrong.
According to the blog article...
I did mount my ResourceReference.
The ResourceReference returns an instance of Resource which loads my image.
I did override equals() of Resource to let wicket determine the correct instance.
But... the code never runs through equals().
I always get an new Resource instance (getResource() of the ResourceReference is called multiple times)
Due to that, my lastModified date flags I set in the Resource are (still) lost.
So the browser is now able to cache, because the urls are stable, but the expire dates in request header forces the browser to load the image again.
It seems the ResourceReferenceRegistry is not working correct... somehow...
kind regards
Patrick
-----Ursprüngliche Nachricht-----
Von: Martin Grigorov [mailto:mgrigorov@apache.org]
Gesendet: Donnerstag, 9. Juni 2016 15:14
An: users@wicket.apache.org
Betreff: Re: Conditional (static) dynamic resources / ;-)
See org.apache.wicket.markup.html.image.Image#Image(java.lang.String,
org.apache.wicket.request.resource.ResourceReference,
org.apache.wicket.request.mapper.parameter.PageParameters,
org.apache.wicket.request.resource.ResourceReference...)
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Thu, Jun 9, 2016 at 2:34 PM, Davids Patrick <P....@healthag.de> wrote:
> Hi Martin,
> but how do I put the particular parameter into the Image src which
> makes it static?
> I'm not able to manually call
>
> getRequestCycle().urlFor(imagesResourceReference, imageParameters);
>
> What I do is add(new Image, new
> PersonImageResourceReference(personInstance));
>
> How can I provide a parameter personNumer=1234
> (personInstance.getNumber()) to the url the Image create for its own
> src attribute?
>
> Best regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> Gesendet: Dienstag, 7. Juni 2016 17:05
> An: users@wicket.apache.org
> Betreff: Re: Conditional (static) dynamic resources / ;-)
>
> Hi,
>
> I would use mounted resource reference that serves the images.
> Check wicketinaction.com. There is a blog article explaining how to do it.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de>
> wrote:
>
> > Hi all,
> > I have a quite tricky usecase here and I don't know how to handle that.
> >
> > Our system allows to upload user pictures to profiles.
> > So, when the user profile picture is displayed it is read from
> > database and delivered by DynamicImageResource.
> >
> > If the user did not upload any pictures yet an fallback image is
> > delivered (generic male and female).
> >
> > To have them cached/static I thought I can handle this by setting
> > the lastModified flag, but in my case I revoke the behavior, because
> > I am in a refreshing view which re-creates my components, due to
> > that also a new DynamicImageResource is created and my lastModified
> > date information is lost.
> >
> > What could be the best practice to achieve a "conditional caching"
> > for (Dynamic)ImageResources?
> >
> > Kind regards
> > Patrick
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
AW: Conditional (static) dynamic resources / ;-)
Posted by Davids Patrick <P....@healthag.de>.
Hi Martin,
sorry for the delay.
Issue with quickstart is created.
https://issues.apache.org/jira/browse/WICKET-6195
best regards
Patrick
Health AG | Patrick Davids | Softwareentwickler
Tel. +49 40 524 709-258 | p.davids@healthag.de
Fax +49 40 524 709-258 | www.healthag.de
EOS Health Honorarmanagement AG | Lübeckertordamm 1–3 | 20099 Hamburg | AG Hamburg HRB 93806
Vorstand | Jens Törper, Uwe Schäfer
Aufsichtsratsvorsitzender | Klaus Engberding
Save a tree – think before you print.
-----Ursprüngliche Nachricht-----
Von: Martin Grigorov [mailto:mgrigorov@apache.org]
Gesendet: Dienstag, 14. Juni 2016 13:05
An: users@wicket.apache.org
Betreff: Re: Conditional (static) dynamic resources / ;-)
Hi,
I think it should work with different instances too when #equals() is implemented.
Please create a quickstart and attach it to JIRA.
Thanks!
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Jun 14, 2016 at 12:21 PM, Davids Patrick <P....@healthag.de>
wrote:
> Hi Martin,
> some news...
>
> It is working when I keep a (java-code-)reference to the Resource
> instance in my ResourceReference.
> So, I always returning the same instance when wicket calls
> ResourceReference#getResource().
>
> But, this is not the way it should be, right?
>
> kind regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Davids Patrick
> Gesendet: Freitag, 10. Juni 2016 10:08
> An: 'users@wicket.apache.org'
> Betreff: AW: Conditional (static) dynamic resources / ;-)
>
> Hi Martin,
> ok... working... but not as expected.
>
> My urls are stable and cachable.
>
> But I dont know, what I do wrong.
> According to the blog article...
>
> I did mount my ResourceReference.
> The ResourceReference returns an instance of Resource which loads my image.
> I did override equals() of Resource to let wicket determine the
> correct instance.
>
> But... the code never runs through equals().
> I always get an new Resource instance (getResource() of the
> ResourceReference is called multiple times) Due to that, my
> lastModified date flags I set in the Resource are (still) lost.
>
> So the browser is now able to cache, because the urls are stable, but
> the expire dates in request header forces the browser to load the image again.
>
> It seems the ResourceReferenceRegistry is not working correct... somehow...
>
> kind regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> Gesendet: Donnerstag, 9. Juni 2016 15:14
> An: users@wicket.apache.org
> Betreff: Re: Conditional (static) dynamic resources / ;-)
>
> See org.apache.wicket.markup.html.image.Image#Image(java.lang.String,
> org.apache.wicket.request.resource.ResourceReference,
> org.apache.wicket.request.mapper.parameter.PageParameters,
> org.apache.wicket.request.resource.ResourceReference...)
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Jun 9, 2016 at 2:34 PM, Davids Patrick <P....@healthag.de>
> wrote:
>
> > Hi Martin,
> > but how do I put the particular parameter into the Image src which
> > makes it static?
> > I'm not able to manually call
> >
> > getRequestCycle().urlFor(imagesResourceReference, imageParameters);
> >
> > What I do is add(new Image, new
> > PersonImageResourceReference(personInstance));
> >
> > How can I provide a parameter personNumer=1234
> > (personInstance.getNumber()) to the url the Image create for its own
> > src attribute?
> >
> > Best regards
> > Patrick
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> > Gesendet: Dienstag, 7. Juni 2016 17:05
> > An: users@wicket.apache.org
> > Betreff: Re: Conditional (static) dynamic resources / ;-)
> >
> > Hi,
> >
> > I would use mounted resource reference that serves the images.
> > Check wicketinaction.com. There is a blog article explaining how to
> > do
> it.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick
> > <P....@healthag.de>
> > wrote:
> >
> > > Hi all,
> > > I have a quite tricky usecase here and I don't know how to handle that.
> > >
> > > Our system allows to upload user pictures to profiles.
> > > So, when the user profile picture is displayed it is read from
> > > database and delivered by DynamicImageResource.
> > >
> > > If the user did not upload any pictures yet an fallback image is
> > > delivered (generic male and female).
> > >
> > > To have them cached/static I thought I can handle this by setting
> > > the lastModified flag, but in my case I revoke the behavior,
> > > because I am in a refreshing view which re-creates my components,
> > > due to that also a new DynamicImageResource is created and my
> > > lastModified date information is lost.
> > >
> > > What could be the best practice to achieve a "conditional caching"
> > > for (Dynamic)ImageResources?
> > >
> > > Kind regards
> > > Patrick
> > >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Conditional (static) dynamic resources / ;-)
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
I think it should work with different instances too when #equals() is
implemented.
Please create a quickstart and attach it to JIRA.
Thanks!
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Jun 14, 2016 at 12:21 PM, Davids Patrick <P....@healthag.de>
wrote:
> Hi Martin,
> some news...
>
> It is working when I keep a (java-code-)reference to the Resource instance
> in my ResourceReference.
> So, I always returning the same instance when wicket calls
> ResourceReference#getResource().
>
> But, this is not the way it should be, right?
>
> kind regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Davids Patrick
> Gesendet: Freitag, 10. Juni 2016 10:08
> An: 'users@wicket.apache.org'
> Betreff: AW: Conditional (static) dynamic resources / ;-)
>
> Hi Martin,
> ok... working... but not as expected.
>
> My urls are stable and cachable.
>
> But I dont know, what I do wrong.
> According to the blog article...
>
> I did mount my ResourceReference.
> The ResourceReference returns an instance of Resource which loads my image.
> I did override equals() of Resource to let wicket determine the correct
> instance.
>
> But... the code never runs through equals().
> I always get an new Resource instance (getResource() of the
> ResourceReference is called multiple times) Due to that, my lastModified
> date flags I set in the Resource are (still) lost.
>
> So the browser is now able to cache, because the urls are stable, but the
> expire dates in request header forces the browser to load the image again.
>
> It seems the ResourceReferenceRegistry is not working correct... somehow...
>
> kind regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> Gesendet: Donnerstag, 9. Juni 2016 15:14
> An: users@wicket.apache.org
> Betreff: Re: Conditional (static) dynamic resources / ;-)
>
> See org.apache.wicket.markup.html.image.Image#Image(java.lang.String,
> org.apache.wicket.request.resource.ResourceReference,
> org.apache.wicket.request.mapper.parameter.PageParameters,
> org.apache.wicket.request.resource.ResourceReference...)
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Jun 9, 2016 at 2:34 PM, Davids Patrick <P....@healthag.de>
> wrote:
>
> > Hi Martin,
> > but how do I put the particular parameter into the Image src which
> > makes it static?
> > I'm not able to manually call
> >
> > getRequestCycle().urlFor(imagesResourceReference, imageParameters);
> >
> > What I do is add(new Image, new
> > PersonImageResourceReference(personInstance));
> >
> > How can I provide a parameter personNumer=1234
> > (personInstance.getNumber()) to the url the Image create for its own
> > src attribute?
> >
> > Best regards
> > Patrick
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> > Gesendet: Dienstag, 7. Juni 2016 17:05
> > An: users@wicket.apache.org
> > Betreff: Re: Conditional (static) dynamic resources / ;-)
> >
> > Hi,
> >
> > I would use mounted resource reference that serves the images.
> > Check wicketinaction.com. There is a blog article explaining how to do
> it.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de>
> > wrote:
> >
> > > Hi all,
> > > I have a quite tricky usecase here and I don't know how to handle that.
> > >
> > > Our system allows to upload user pictures to profiles.
> > > So, when the user profile picture is displayed it is read from
> > > database and delivered by DynamicImageResource.
> > >
> > > If the user did not upload any pictures yet an fallback image is
> > > delivered (generic male and female).
> > >
> > > To have them cached/static I thought I can handle this by setting
> > > the lastModified flag, but in my case I revoke the behavior, because
> > > I am in a refreshing view which re-creates my components, due to
> > > that also a new DynamicImageResource is created and my lastModified
> > > date information is lost.
> > >
> > > What could be the best practice to achieve a "conditional caching"
> > > for (Dynamic)ImageResources?
> > >
> > > Kind regards
> > > Patrick
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>
AW: Conditional (static) dynamic resources / ;-)
Posted by Davids Patrick <P....@healthag.de>.
Hi Martin,
some news...
It is working when I keep a (java-code-)reference to the Resource instance in my ResourceReference.
So, I always returning the same instance when wicket calls ResourceReference#getResource().
But, this is not the way it should be, right?
kind regards
Patrick
-----Ursprüngliche Nachricht-----
Von: Davids Patrick
Gesendet: Freitag, 10. Juni 2016 10:08
An: 'users@wicket.apache.org'
Betreff: AW: Conditional (static) dynamic resources / ;-)
Hi Martin,
ok... working... but not as expected.
My urls are stable and cachable.
But I dont know, what I do wrong.
According to the blog article...
I did mount my ResourceReference.
The ResourceReference returns an instance of Resource which loads my image.
I did override equals() of Resource to let wicket determine the correct instance.
But... the code never runs through equals().
I always get an new Resource instance (getResource() of the ResourceReference is called multiple times) Due to that, my lastModified date flags I set in the Resource are (still) lost.
So the browser is now able to cache, because the urls are stable, but the expire dates in request header forces the browser to load the image again.
It seems the ResourceReferenceRegistry is not working correct... somehow...
kind regards
Patrick
-----Ursprüngliche Nachricht-----
Von: Martin Grigorov [mailto:mgrigorov@apache.org]
Gesendet: Donnerstag, 9. Juni 2016 15:14
An: users@wicket.apache.org
Betreff: Re: Conditional (static) dynamic resources / ;-)
See org.apache.wicket.markup.html.image.Image#Image(java.lang.String,
org.apache.wicket.request.resource.ResourceReference,
org.apache.wicket.request.mapper.parameter.PageParameters,
org.apache.wicket.request.resource.ResourceReference...)
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Thu, Jun 9, 2016 at 2:34 PM, Davids Patrick <P....@healthag.de> wrote:
> Hi Martin,
> but how do I put the particular parameter into the Image src which
> makes it static?
> I'm not able to manually call
>
> getRequestCycle().urlFor(imagesResourceReference, imageParameters);
>
> What I do is add(new Image, new
> PersonImageResourceReference(personInstance));
>
> How can I provide a parameter personNumer=1234
> (personInstance.getNumber()) to the url the Image create for its own
> src attribute?
>
> Best regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> Gesendet: Dienstag, 7. Juni 2016 17:05
> An: users@wicket.apache.org
> Betreff: Re: Conditional (static) dynamic resources / ;-)
>
> Hi,
>
> I would use mounted resource reference that serves the images.
> Check wicketinaction.com. There is a blog article explaining how to do it.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de>
> wrote:
>
> > Hi all,
> > I have a quite tricky usecase here and I don't know how to handle that.
> >
> > Our system allows to upload user pictures to profiles.
> > So, when the user profile picture is displayed it is read from
> > database and delivered by DynamicImageResource.
> >
> > If the user did not upload any pictures yet an fallback image is
> > delivered (generic male and female).
> >
> > To have them cached/static I thought I can handle this by setting
> > the lastModified flag, but in my case I revoke the behavior, because
> > I am in a refreshing view which re-creates my components, due to
> > that also a new DynamicImageResource is created and my lastModified
> > date information is lost.
> >
> > What could be the best practice to achieve a "conditional caching"
> > for (Dynamic)ImageResources?
> >
> > Kind regards
> > Patrick
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
Re: Conditional (static) dynamic resources / ;-)
Posted by Martin Grigorov <mg...@apache.org>.
See org.apache.wicket.markup.html.image.Image#Image(java.lang.String,
org.apache.wicket.request.resource.ResourceReference,
org.apache.wicket.request.mapper.parameter.PageParameters,
org.apache.wicket.request.resource.ResourceReference...)
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Thu, Jun 9, 2016 at 2:34 PM, Davids Patrick <P....@healthag.de> wrote:
> Hi Martin,
> but how do I put the particular parameter into the Image src which makes
> it static?
> I'm not able to manually call
>
> getRequestCycle().urlFor(imagesResourceReference, imageParameters);
>
> What I do is add(new Image, new
> PersonImageResourceReference(personInstance));
>
> How can I provide a parameter personNumer=1234
> (personInstance.getNumber()) to the url the Image create for its own src
> attribute?
>
> Best regards
> Patrick
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Grigorov [mailto:mgrigorov@apache.org]
> Gesendet: Dienstag, 7. Juni 2016 17:05
> An: users@wicket.apache.org
> Betreff: Re: Conditional (static) dynamic resources / ;-)
>
> Hi,
>
> I would use mounted resource reference that serves the images.
> Check wicketinaction.com. There is a blog article explaining how to do it.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de>
> wrote:
>
> > Hi all,
> > I have a quite tricky usecase here and I don't know how to handle that.
> >
> > Our system allows to upload user pictures to profiles.
> > So, when the user profile picture is displayed it is read from
> > database and delivered by DynamicImageResource.
> >
> > If the user did not upload any pictures yet an fallback image is
> > delivered (generic male and female).
> >
> > To have them cached/static I thought I can handle this by setting the
> > lastModified flag, but in my case I revoke the behavior, because I am
> > in a refreshing view which re-creates my components, due to that also
> > a new DynamicImageResource is created and my lastModified date
> > information is lost.
> >
> > What could be the best practice to achieve a "conditional caching" for
> > (Dynamic)ImageResources?
> >
> > Kind regards
> > Patrick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
AW: Conditional (static) dynamic resources / ;-)
Posted by Davids Patrick <P....@healthag.de>.
Hi Martin,
but how do I put the particular parameter into the Image src which makes it static?
I'm not able to manually call
getRequestCycle().urlFor(imagesResourceReference, imageParameters);
What I do is add(new Image, new PersonImageResourceReference(personInstance));
How can I provide a parameter personNumer=1234 (personInstance.getNumber()) to the url the Image create for its own src attribute?
Best regards
Patrick
-----Ursprüngliche Nachricht-----
Von: Martin Grigorov [mailto:mgrigorov@apache.org]
Gesendet: Dienstag, 7. Juni 2016 17:05
An: users@wicket.apache.org
Betreff: Re: Conditional (static) dynamic resources / ;-)
Hi,
I would use mounted resource reference that serves the images.
Check wicketinaction.com. There is a blog article explaining how to do it.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de> wrote:
> Hi all,
> I have a quite tricky usecase here and I don't know how to handle that.
>
> Our system allows to upload user pictures to profiles.
> So, when the user profile picture is displayed it is read from
> database and delivered by DynamicImageResource.
>
> If the user did not upload any pictures yet an fallback image is
> delivered (generic male and female).
>
> To have them cached/static I thought I can handle this by setting the
> lastModified flag, but in my case I revoke the behavior, because I am
> in a refreshing view which re-creates my components, due to that also
> a new DynamicImageResource is created and my lastModified date
> information is lost.
>
> What could be the best practice to achieve a "conditional caching" for
> (Dynamic)ImageResources?
>
> Kind regards
> Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
AW: Conditional (static) dynamic resources / ;-)
Posted by Davids Patrick <P....@healthag.de>.
Found...
Thanx, I will have a look.
Best regards
Patrick
-----Ursprüngliche Nachricht-----
Von: Martin Grigorov [mailto:mgrigorov@apache.org]
Gesendet: Dienstag, 7. Juni 2016 17:05
An: users@wicket.apache.org
Betreff: Re: Conditional (static) dynamic resources / ;-)
Hi,
I would use mounted resource reference that serves the images.
Check wicketinaction.com. There is a blog article explaining how to do it.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de> wrote:
> Hi all,
> I have a quite tricky usecase here and I don't know how to handle that.
>
> Our system allows to upload user pictures to profiles.
> So, when the user profile picture is displayed it is read from
> database and delivered by DynamicImageResource.
>
> If the user did not upload any pictures yet an fallback image is
> delivered (generic male and female).
>
> To have them cached/static I thought I can handle this by setting the
> lastModified flag, but in my case I revoke the behavior, because I am
> in a refreshing view which re-creates my components, due to that also
> a new DynamicImageResource is created and my lastModified date
> information is lost.
>
> What could be the best practice to achieve a "conditional caching" for
> (Dynamic)ImageResources?
>
> Kind regards
> Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Conditional (static) dynamic resources / ;-)
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
I would use mounted resource reference that serves the images.
Check wicketinaction.com. There is a blog article explaining how to do it.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Jun 7, 2016 at 4:57 PM, Davids Patrick <P....@healthag.de> wrote:
> Hi all,
> I have a quite tricky usecase here and I don't know how to handle that.
>
> Our system allows to upload user pictures to profiles.
> So, when the user profile picture is displayed it is read from database
> and delivered by DynamicImageResource.
>
> If the user did not upload any pictures yet an fallback image is delivered
> (generic male and female).
>
> To have them cached/static I thought I can handle this by setting the
> lastModified flag, but in my case I revoke the behavior, because I am in a
> refreshing view which re-creates my components, due to that also a new
> DynamicImageResource is created and my lastModified date information is
> lost.
>
> What could be the best practice to achieve a "conditional caching" for
> (Dynamic)ImageResources?
>
> Kind regards
> Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>