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

Peter Ertl commented on WICKET-3987:
------------------------------------

Like Martin said, you can use a custom caching strategy.

sample
-------------

        private abstract class CustomResourceCachingStrategy implements 
IResourceCachingStrategy
        {
                private final IResourceCachingStrategy delegate;

                public CustomResourceCachingStrategy(IResourceCachingStrategy 
delegate)
                {
                        this.delegate = delegate;
                }

                @Override
                public void decorateUrl(ResourceUrl url, 
IStaticCacheableResource resource)
                {
                        if (shouldCache(resource))
                        {
                                delegate.decorateUrl(url, resource);
                        }
                }

                @Override
                public void undecorateUrl(ResourceUrl url)
                {
                        delegate.undecorateUrl(url);
                }

                @Override
                public void decorateResponse(AbstractResource.ResourceResponse 
response, IStaticCacheableResource resource)
                {
                        if (shouldCache(resource))
                        {
                                delegate.decorateResponse(response, resource);
                        }
                }

                // override for your needs e.g. by using a marker interface
                protected abstract boolean shouldCache(IStaticCacheableResource 
resource);
        }

and use it like this:


                final IResourceCachingStrategy delegate = 
getResourceSettings().getCachingStrategy();
                getResourceSettings().setCachingStrategy(new 
CustomResourceCachingStrategy(delegate));



> setUseTimestampOnResources and PackageResourceReference#getLastModified 
> removed
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-3987
>                 URL: https://issues.apache.org/jira/browse/WICKET-3987
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.0
>         Environment: 1.5.0 trunk
>            Reporter: Konstantin Ignatyev
>            Assignee: Peter Ertl
>
> IResourceSettings#setUseTimestampOnResources and 
> PackageResourceReference#getLastModified removed in the trunk breaking some 
> of my components which rendered JScript reference from a component package. 
> Now URL has timestamp and therefore parts of JScript relying on relative to 
> the script positions of assets stopped working.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to