[ 
https://issues.apache.org/jira/browse/WICKET-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540230
 ] 

Sebastiaan van Erk commented on WICKET-1128:
--------------------------------------------

Hi,

Thanks for the tip, I had not thought of that yet (nor realized that the 
putInCache method was intended for overriding).

However, I still would prefer that wicket would do this automatically in 
development mode because:

1) wicket already seems to go to some length to clear the cache when in 
development mode (watching resources for modification), but currently fails to 
notice new resources being added; so currently it seems inconsistent (I have to 
restart the application (sometimes) after I add a properties file, but not 
after I edit an existing one).

2) In development mode the strategy seems to always show the most up to date  
version, currently the localizer does not adhere to this strategy...

3) It feels "buggy" the way it is now, sometimes the localized strings get 
updated, sometimes they don't, and it took me a while to figure out what the 
underlying reason was.

4) I think it would help other developers as well, rather than me personally 
overriding the Localizer's putIntoCache to check for devel mode and become a 
null operation. It is not a trivial thing to come up with (requires some 
knowledge of wicket internals) and personally I think it would be useful (and 
more consistent, see also point 2 above) if Wicket defaulted to not caching in 
development mode.


Regards,
Sebastiaan



> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in 
> development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that 
> is being watched is changed. However:
> * if you add a new properties file for a page or component after you already 
> rendered the page once the cache is not cleared and it keeps finding the 
> key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never 
> flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in 
> development mode, but I think a Settings options could be nice to just turn 
> off caching (my laptop is fast enough, I really don't care if it tries to 
> resolve all the labels all the time). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to