Search in sources :

Example 6 with FilenameWithVersionResourceCachingStrategy

use of org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy in project wicket by apache.

the class CssUrlReplacerTest method newApplication.

@Override
protected WebApplication newApplication() {
    return new MockApplication() {

        @Override
        protected void init() {
            super.init();
            getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy("=VER=", new MessageDigestResourceVersion()) {

                @Override
                public void decorateUrl(ResourceUrl url, IStaticCacheableResource resource) {
                    url.setFileName(url.getFileName() + DECORATION_SUFFIX);
                }
            });
        }

        @Override
        public Session newSession(Request request, Response response) {
            Session newSession = super.newSession(request, response);
            newSession.setLocale(Locale.ROOT);
            return newSession;
        }
    };
}
Also used : FilenameWithVersionResourceCachingStrategy(org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy) IStaticCacheableResource(org.apache.wicket.request.resource.caching.IStaticCacheableResource) Response(org.apache.wicket.request.Response) MockApplication(org.apache.wicket.mock.MockApplication) Request(org.apache.wicket.request.Request) MessageDigestResourceVersion(org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion) ResourceUrl(org.apache.wicket.request.resource.caching.ResourceUrl) Session(org.apache.wicket.Session)

Aggregations

FilenameWithVersionResourceCachingStrategy (org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy)6 CachingResourceVersion (org.apache.wicket.request.resource.caching.version.CachingResourceVersion)4 MessageDigestResourceVersion (org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion)3 RenderJavaScriptToFooterHeaderResponseDecorator (de.agilecoders.wicket.core.markup.html.RenderJavaScriptToFooterHeaderResponseDecorator)2 Adler32ResourceVersion (de.agilecoders.wicket.core.request.resource.caching.version.Adler32ResourceVersion)2 GoogleClosureJavaScriptCompressor (de.agilecoders.wicket.extensions.javascript.GoogleClosureJavaScriptCompressor)2 YuiCssCompressor (de.agilecoders.wicket.extensions.javascript.YuiCssCompressor)2 MockApplication (org.apache.wicket.mock.MockApplication)2 IStaticCacheableResource (org.apache.wicket.request.resource.caching.IStaticCacheableResource)2 NoOpResourceCachingStrategy (org.apache.wicket.request.resource.caching.NoOpResourceCachingStrategy)2 ResourceUrl (org.apache.wicket.request.resource.caching.ResourceUrl)2 DeflatedJavaSerializer (org.apache.wicket.serialize.java.DeflatedJavaSerializer)2 Session (org.apache.wicket.Session)1 Request (org.apache.wicket.request.Request)1 Response (org.apache.wicket.request.Response)1 INamedParameters (org.apache.wicket.request.mapper.parameter.INamedParameters)1 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)1 CssResourceReference (org.apache.wicket.request.resource.CssResourceReference)1 IResourceCachingStrategy (org.apache.wicket.request.resource.caching.IResourceCachingStrategy)1 IResourceVersion (org.apache.wicket.request.resource.caching.version.IResourceVersion)1