eddyson-de / tapestry-minification-cache-warming

Warm up Tapestry's minification cache during application startup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tapestry-minification-cache-warming status

Join the chat at https://gitter.im/eddyson-de/tapestry-minification-cache-warming Control which resources are pre-minified during the application's startup.

Tapestry can minify resources like JavaScript modules and CSS stylesheets during runtime. This is done lazily when the resources are first requested. When the minification process becomes complex, this can take a considerable amount of time, slowing down the first requests' processing.

With this module, resources can be added to a cache warming phase. This makes the application startup take a little longer but will help to answer all requests equally fast.

Usage

A basic usage example to override Tapestry's shipped jQuery library with a newer version.

build.gradle:

respositories {
  maven { url "https://jitpack.io" }
}

dependencies {
  implementation 'com.github.eddyson-de:tapestry-minification-cache-warming:0.2.0'
}

Application Module:

@Contribute(MinificationCacheWarming.class)
public static void configureMinificationCacheWarming(
    final OrderedConfiguration<StackExtension> configuration) {
  configuration.add("stack:core", StackExtension.stack("core"));
  configuration.add("module:bootstrap/modal", StackExtension.module("bootstrap/modal"));
  configuration.add("stylesheet:tapestry.css",
    StackExtension.stylesheet("${tapestry.asset.root}/tapestry.css"));
}

About

Warm up Tapestry's minification cache during application startup

License:Apache License 2.0


Languages

Language:Java 87.9%Language:Groovy 12.1%