You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2017/01/25 19:01:16 UTC

IMarkupCacheKeyProvider getCacheKey

I am trying to make Wicket NOT cache html templates, but only based on a
certain system property.  So if this property is off, no caching, I return
null from getCacheKey() and that seems to work great.  But, I am not sure
what to do when I WANT caching.  

The method takes a MarkupContainer and containerClass parameter, but I am
unsure what I am supposed to do with them. I presume I am supposed to
manufacture a key somehow.  But not knowing how the key is used, I am
unclear how to generate it.  Is there a default implementation of this I
could utilize?  Every example I find online is just returning null in order
to achieve no caching ALL the time.  But I only want it conditionally.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/IMarkupCacheKeyProvider-getCacheKey-tp4676864.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IMarkupCacheKeyProvider getCacheKey

Posted by Entropy <bl...@gmail.com>.
Perfect.  Thanks.


Brian Mulholland
"For every complex problem, there is an answer that is clear, simple and
wrong."
--H.L. Mencken
"Politics is the art of looking for trouble, finding it everywhere,
diagnosing it incorrectly, and applying the wrong remedies."
--Groucho Marx

On Wed, Jan 25, 2017 at 3:14 PM, Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4676868h72@n4.nabble.com> wrote:

> Hi,
>
> The default impl is org.apache.wicket.markup.DefaultMarkupCacheKeyProvider.
>
> So instead of implementing the interface you need to extend from this
> class
> and return null or super.getCacheKey().
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 25, 2017 at 8:01 PM, Entropy <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4676868&i=0>> wrote:
>
> > I am trying to make Wicket NOT cache html templates, but only based on a
> > certain system property.  So if this property is off, no caching, I
> return
> > null from getCacheKey() and that seems to work great.  But, I am not
> sure
> > what to do when I WANT caching.
> >
> > The method takes a MarkupContainer and containerClass parameter, but I
> am
> > unsure what I am supposed to do with them. I presume I am supposed to
> > manufacture a key somehow.  But not knowing how the key is used, I am
> > unclear how to generate it.  Is there a default implementation of this I
> > could utilize?  Every example I find online is just returning null in
> order
> > to achieve no caching ALL the time.  But I only want it conditionally.
> >
> > --
> > View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/
> > IMarkupCacheKeyProvider-getCacheKey-tp4676864.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4676868&i=1>
> > For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4676868&i=2>
> >
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-wicket.1842946.n4.nabble.com/IMarkupCacheKeyProvider-
> getCacheKey-tp4676864p4676868.html
> To unsubscribe from IMarkupCacheKeyProvider getCacheKey, click here
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4676864&code=YmxtdWxob2xsYW5kQGdtYWlsLmNvbXw0Njc2ODY0fC05NzMyODEwMzU=>
> .
> NAML
> <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/IMarkupCacheKeyProvider-getCacheKey-tp4676864p4676870.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IMarkupCacheKeyProvider getCacheKey

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

The default impl is org.apache.wicket.markup.DefaultMarkupCacheKeyProvider.
So instead of implementing the interface you need to extend from this class
and return null or super.getCacheKey().

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 25, 2017 at 8:01 PM, Entropy <bl...@gmail.com> wrote:

> I am trying to make Wicket NOT cache html templates, but only based on a
> certain system property.  So if this property is off, no caching, I return
> null from getCacheKey() and that seems to work great.  But, I am not sure
> what to do when I WANT caching.
>
> The method takes a MarkupContainer and containerClass parameter, but I am
> unsure what I am supposed to do with them. I presume I am supposed to
> manufacture a key somehow.  But not knowing how the key is used, I am
> unclear how to generate it.  Is there a default implementation of this I
> could utilize?  Every example I find online is just returning null in order
> to achieve no caching ALL the time.  But I only want it conditionally.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/
> IMarkupCacheKeyProvider-getCacheKey-tp4676864.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>