Skip to content

Commit

Permalink
Add option "--disableFileCache" for development.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentg committed Jul 2, 2015
1 parent 6b694ee commit 0470665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Expand Up @@ -106,6 +106,9 @@ public class CommandLineParameters implements Cloneable {
description = "Path to directory containing local client files to serve.")
public File clientDirectory = null;

@Parameter(names = {"--disableFileCache"}, description = "Disable http server static file cache. Handy for development.")
public boolean disableFileCache = false;

@Parameter(names = {"--router"}, validateWith = RouterId.class,
description = "One or more router IDs to build and/or serve, first one being the default.")
public List<String> routerIds;
Expand Down
Expand Up @@ -95,7 +95,11 @@ public void run() {
httpServer.getServerConfiguration().addHttpHandler(dynamicHandler, "/otp/");

/* 2. A static content handler to serve the client JS apps etc. from the classpath. */
HttpHandler staticHandler = new CLStaticHttpHandler(GrizzlyServer.class.getClassLoader(), "/client/");
CLStaticHttpHandler staticHandler = new CLStaticHttpHandler(GrizzlyServer.class.getClassLoader(), "/client/");
if (params.disableFileCache) {
LOG.info("Disabling HTTP server static file cache.");
staticHandler.setFileCacheEnabled(false);
}
httpServer.getServerConfiguration().addHttpHandler(staticHandler, "/");

/*
Expand Down

0 comments on commit 0470665

Please sign in to comment.