[jira] [Commented] (TAP5-2325) Minification cache warming
[ https://issues.apache.org/jira/browse/TAP5-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14074213#comment-14074213 ] Jochen Kemnade commented on TAP5-2325: -- That code will not work anymore with -beta-14 or later: TAP5-2139 / {{accbb5374aa29333d2a666d4225c66a77b56581f}} requires a {{Request}} to be available when acquiring a {{StreamableResource}}. Minification cache warming -- Key: TAP5-2325 URL: https://issues.apache.org/jira/browse/TAP5-2325 Project: Tapestry 5 Issue Type: New Feature Components: tapestry-core Affects Versions: 5.4 Reporter: Jochen Kemnade Priority: Minor It should be possible to configure that certain resources that should be minified during the application startup, the rationale being that it can take some time to minify large assets and that can lead to timeouts in requirejs when the resource is requested for the first time. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TAP5-2325) Minification cache warming
[ https://issues.apache.org/jira/browse/TAP5-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13977998#comment-13977998 ] Dragan Sahpaski commented on TAP5-2325: --- Nice!. I've been wanting this for some time now. Minification cache warming -- Key: TAP5-2325 URL: https://issues.apache.org/jira/browse/TAP5-2325 Project: Tapestry 5 Issue Type: New Feature Components: tapestry-core Affects Versions: 5.4 Reporter: Jochen Kemnade It should be possible to configure that certain resources that should be minified during the application startup, the rationale being that it can take some time to minify large assets and that can lead to timeouts in requirejs when the resource is requested for the first time. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TAP5-2325) Minification cache warming
[ https://issues.apache.org/jira/browse/TAP5-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13978005#comment-13978005 ] Jochen Kemnade commented on TAP5-2325: -- Then I'll happily provide my workaround for the meantime. It works for modules and goes like this: {code:title=AppModule.java|borderStyle=solid} @Startup public static void warmMinifiedJavascriptCache(final ModuleManager moduleManager, final ResourceStreamer resourceStreamer, final StreamableResourceSource streamableResourceSource, final ResourceChangeTracker resourceChangeTracker, final JavaScriptStackAssembler javaScriptStackAssembler, @Symbol(SymbolConstants.MINIFICATION_ENABLED) final boolean minificationEnabled) throws IOException { if (minificationEnabled) { // the modules that should me minified upon the application startup String[] modules = new String[] { moment, codemirror/lib/codemirror }; // resolve the modules to actual resources ListResource resources = CollectionFactory.newLinkedList(); for (String module : modules) { resources.add(moduleManager.findResourceForModule(module)); } // request StreamableResource instances for all the resources to populate the cache for (Resource resource : resources) { streamableResourceSource.getStreamableResource(resource, StreamableResourceProcessing.COMPRESSION_DISABLED, resourceChangeTracker); } } } {code} Minification cache warming -- Key: TAP5-2325 URL: https://issues.apache.org/jira/browse/TAP5-2325 Project: Tapestry 5 Issue Type: New Feature Components: tapestry-core Affects Versions: 5.4 Reporter: Jochen Kemnade It should be possible to configure that certain resources that should be minified during the application startup, the rationale being that it can take some time to minify large assets and that can lead to timeouts in requirejs when the resource is requested for the first time. -- This message was sent by Atlassian JIRA (v6.2#6252)