//For the Cached Index Handler, we are always serving /index.html with the
//content type text/html
String path = "/index.html";
String contentType = "text/html";
ScriptCache cache = ScriptHash.getScriptCache(path);
if (cache == null || cache.isExpired()) {
//If file is not cached, or cache is expired, update the cache.
logger.info("Updating index.html from filesystem path: " + path);
cache = updateScriptCacheForPath(path);
}
String htmlContents = cache.getHtmlContents();
DefaultHttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK);;
response.setHeader(HttpHeaders.Names.CONTENT_TYPE, contentType);
writeContentsToBuffer(ctx, htmlContents, "text/html");