You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (Commented) (JIRA)" <ji...@apache.org> on 2011/11/20 14:53:51 UTC

[jira] [Commented] (WICKET-4131) Add a non-caching RenderedDynamicImageResource

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

Carl-Eric Menzel commented on WICKET-4131:
------------------------------------------

Sorry for the late reply.

#invalidate comes close, but doesn't quite fix it. With #invalidate() I have to call that every time I need to render something new, and I have to call that from outside the resource. We're rendering live statistical data, and so the image should be fresh on each reload. I can't call #invalidate() from within #render() though.

I think #invalidate() and NonCachingRDIR would serve two different purposes. #invalidate() is for images that *can* change but the change is far enough in the future that caching is worthwhile. NCRDIR (that name may be too long ;-) ) on the other hand is for situations when caching makes no sense at all and I always want a fresh image to be drawn.

So I propose keeping invalidate, adding NCRDIR and improving the documentation to mention invalidate and NCRDIR in the javadoc of RDIR and RDIR#render. 
                
> Add a non-caching RenderedDynamicImageResource
> ----------------------------------------------
>
>                 Key: WICKET-4131
>                 URL: https://issues.apache.org/jira/browse/WICKET-4131
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5.2
>            Reporter: Carl-Eric Menzel
>         Attachments: 0001-WICKET-4131-Add-NonCachingRenderedDynamicImageResour.patch
>
>
> RenderedDynamicImageResource ignores all cache settings and keeps its image data once it has been rendered. This is not very useful for tasks like rendering statistics which will be reloaded often but with identical parameters, yet still need to show updated charts.
> Ideally, RenderedDynamicImageResource's getImageData() method should check these cache settings, however, they are not available at that point -- please correct me if I'm wrong here.
> Another option would be to simply change getImageData()'s behavior to not cache anything. That might break existing code though, so I think we shouldn't do that right now.
> As a fallback I propose adding a NonCachingRenderedDynamicImageResource that prevents caching. This can then be used as a drop-in replacement for the regular RDIR whenever caching should be avoided.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira