List of usage examples for org.apache.wicket.serialize.java DeflatedJavaSerializer DeflatedJavaSerializer
public DeflatedJavaSerializer(String applicationKey)
From source file:org.devgateway.toolkit.forms.wicket.FormsWebApplication.java
License:Open Source License
/** * optimize wicket for a better web performance This will be invoked if the * application is started with -Dwicket.configuration=deployment *///w ww .j av a 2 s. c o m private void optimizeForWebPerformance() { // add javascript files at the bottom of the page setHeaderResponseDecorator(new RenderJavaScriptToFooterHeaderResponseDecorator("scripts-bucket")); // This is only enabled for deployment configuration // -Dwicket.configuration=deployment // The default is Development, so this code is not used if (usesDeploymentConfig()) { getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy("-v-", new CachingResourceVersion(new Adler32ResourceVersion()))); getResourceSettings().setJavaScriptCompressor( new GoogleClosureJavaScriptCompressor(CompilationLevel.SIMPLE_OPTIMIZATIONS)); getResourceSettings().setCssCompressor(new YuiCssCompressor()); getFrameworkSettings().setSerializer(new DeflatedJavaSerializer(getApplicationKey())); getMarkupSettings().setStripComments(true); } else { getResourceSettings().setCachingStrategy(new NoOpResourceCachingStrategy()); } getRequestCycleSettings().setRenderStrategy(RenderStrategy.ONE_PASS_RENDER); }