@Override protected void internalInit() { super.internalInit(); // set page and session store providers setSessionStoreProvider(MockSessionStore::new); setPageManagerProvider((pageManagerContext) -> new MockPageManager()); // for test cases we usually want stable resource names getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE); } }
@Override protected void internalInit() { super.internalInit(); // set page and session store providers setSessionStoreProvider(MockSessionStore::new); setPageManagerProvider((pageManagerContext) -> new MockPageManager()); // for test cases we usually want stable resource names getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE); } }
@Override protected void onConfigure() { super.onConfigure(); // Do not cache pages in development mode - allows us to make changes to the HMTL without // having to reload the application if (RuntimeConfigurationType.DEVELOPMENT.equals(getApplication().getConfigurationType())) { getApplication().getMarkupSettings().getMarkupFactory().getMarkupCache().clear(); getApplication().getResourceSettings() .setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE); } }
@Override protected void onConfigure() { super.onConfigure(); // Do not cache pages in development mode - allows us to make changes to the HMTL without // having to reload the application if (RuntimeConfigurationType.DEVELOPMENT.equals(getApplication().getConfigurationType())) { getApplication().getMarkupSettings().getMarkupFactory().getMarkupCache().clear(); getApplication().getResourceSettings() .setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE); } }
/** * optimize wicket for a better web performance. */ private void optimizeForWebPerformance() { 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())); } else { getResourceSettings().setCachingStrategy(new NoOpResourceCachingStrategy()); } setHeaderResponseDecorator(new RenderJavaScriptToFooterHeaderResponseDecorator()); getRequestCycleSettings().setRenderStrategy( org.apache.wicket.settings.RequestCycleSettings.RenderStrategy.ONE_PASS_RENDER); }