Re: Custom markup cache key in hierarchy

2013-06-07 Thread Sven Meier

Hi,

I think your usage should work. Can you create a quickstart and attach 
it to a Jira issue?


Sven

On 06/05/2013 09:27 PM, Bas Gooren wrote:

Hi *,

We've built a platform which hosts dynamic websites. Websites can be 
added/updated/removed on demand, and all run on a single wicket 
application (wicket 1.5-based).


So far we've used custom css to override the look  feel for each 
websites, providing the websites with a selection of themes (css + 
images).


One of the features we're currently researching is to allow a theme to 
provide custom html to the wicket base page which is used for layout.
We've also built a CMS in wicket, so using 
IMarkupResourceStreamProvider and IMarkupCacheKeyProvider is something 
we've done before.

So far, so good.

The problem is that we have various pages in the app which extend our 
base page (WebsiteLayout), and their markup is not refreshed once the 
layout changes it's theme (and thus has different html).
Even though we return a different markup cache key (it's based on the 
theme ID), and a different markup resource stream, the new markup is 
never loaded.


I think it's due to the fact that pages which extend the layout also 
have their entire markup cached (MergedMarkup).


My original idea was to only provide a custom cache key for the 
layout, and let wicket handle everything else. Then, when the theme 
html is updated, we can simply remove that single cache key from the 
wicket markup cache, and it will be reloaded.


I think we can circumvent that by providing a custom markup cache key 
for all pages which extend the layout, but that creates a bit of a 
hassle for cleaning up the markup cache. It's doable (keep track of 
all cache keys generated for a theme, and remove all of them from the 
cache), but before we proceed I'd like some feedback from others: is 
this the way to go?





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



Custom markup cache key in hierarchy

2013-06-05 Thread Bas Gooren

Hi *,

We've built a platform which hosts dynamic websites. Websites can be 
added/updated/removed on demand, and all run on a single wicket 
application (wicket 1.5-based).


So far we've used custom css to override the look  feel for each 
websites, providing the websites with a selection of themes (css + images).


One of the features we're currently researching is to allow a theme to 
provide custom html to the wicket base page which is used for layout.
We've also built a CMS in wicket, so using IMarkupResourceStreamProvider 
and IMarkupCacheKeyProvider is something we've done before.

So far, so good.

The problem is that we have various pages in the app which extend our 
base page (WebsiteLayout), and their markup is not refreshed once the 
layout changes it's theme (and thus has different html).
Even though we return a different markup cache key (it's based on the 
theme ID), and a different markup resource stream, the new markup is 
never loaded.


I think it's due to the fact that pages which extend the layout also 
have their entire markup cached (MergedMarkup).


My original idea was to only provide a custom cache key for the layout, 
and let wicket handle everything else. Then, when the theme html is 
updated, we can simply remove that single cache key from the wicket 
markup cache, and it will be reloaded.


I think we can circumvent that by providing a custom markup cache key 
for all pages which extend the layout, but that creates a bit of a 
hassle for cleaning up the markup cache. It's doable (keep track of all 
cache keys generated for a theme, and remove all of them from the 
cache), but before we proceed I'd like some feedback from others: is 
this the way to go?


--

Met vriendelijke groet,
Kind regards,

Bas Gooren