Index: mod_wombat.c
===================================================================
--- mod_wombat.c	(revision 534949)
+++ mod_wombat.c	(working copy)
@@ -110,7 +110,7 @@
             ap_rputs("Unable to compile VM, see logs", r);
         }
         lua_getglobal(L, d->function_name);
-	apw_run_wombat_request(L, r);
+		apw_run_wombat_request(L, r);
         if (lua_pcall(L, 1, 0, 0)) {
             report_lua_error(L, r);
         }
@@ -179,7 +179,7 @@
             lua_State* L = apw_rgetvm(r, spec);
             
             lua_getglobal(L, hook_spec->function_name);
-	    apw_run_wombat_request(L, r);
+			apw_run_wombat_request(L, r);
             if (lua_pcall(L, 1, 1, 0)) {
                 report_lua_error(L, r);
                 return 500;
@@ -202,7 +202,7 @@
                                                      const char *file, 
                                                      const char *function) {
     apw_dir_cfg* cfg = (apw_dir_cfg*)_cfg;
-    
+	apw_server_cfg *scfg = ap_get_module_config(cmd->server->module_config, &wombat_module);
     apr_array_header_t *hook_specs = apr_hash_get(cfg->hooks, name, APR_HASH_KEY_STRING);
     if (!hook_specs) {
         hook_specs = apr_array_make(cmd->pool, 2, sizeof(apw_mapped_handler_spec*));
@@ -212,8 +212,8 @@
     apw_mapped_handler_spec *spec = apr_palloc(cmd->pool, sizeof(apw_mapped_handler_spec));
     spec->file_name = apr_pstrdup(cmd->pool, file);
     spec->function_name = apr_pstrdup(cmd->pool, function);
-    spec->scope = APW_SCOPE_ONCE;
-    spec->code_cache_style = APW_CODE_CACHE_STAT;
+    spec->scope = scfg->default_scope;
+    spec->code_cache_style = scfg->default_cache_style;
     /*
         int code_cache_style;
         char *function_name;
@@ -372,6 +372,41 @@
     return NULL;
 }
 
+const char* set_default_cache_style(cmd_parms *cmd, void *_cfg, const char *arg) {
+    apw_server_cfg *cfg = ap_get_module_config(cmd->server->module_config, &wombat_module);
+    int style = APW_CODE_CACHE_STAT;
+    if(0 == strcasecmp(arg, "STAT")) { 
+		style = APW_CODE_CACHE_STAT;
+	} else if(0 == strcasecmp(arg, "FOREVER")) {
+		style = APW_CODE_CACHE_FOREVER;
+	} else if(0 == strcasecmp(arg, "NEVER")) {
+		style = APW_CODE_CACHE_NEVER;
+	} else {
+		return "unknown code cache style";
+	}
+
+	cfg->default_cache_style = style;
+	return NULL;
+}
+const char* set_default_scope(cmd_parms *cmd, void *_cfg, const char *arg) {
+    apw_server_cfg *cfg = ap_get_module_config(cmd->server->module_config, &wombat_module);
+    int scope = APW_SCOPE_ONCE;
+    if(0 == strcasecmp(arg, "ONCE")) { 
+		scope = APW_SCOPE_ONCE;
+	} else if(0 == strcasecmp(arg, "REQUEST")) {
+		scope = APW_SCOPE_REQUEST;
+	} else if(0 == strcasecmp(arg, "CONNECTION")) {
+		scope = APW_SCOPE_CONN;
+	} else if(0 == strcasecmp(arg, "SERVER")) {
+		scope = APW_SCOPE_SERVER;
+	} else {
+		return "unknown scope";
+	}
+	
+	cfg->default_scope = scope;
+	return NULL;
+}
+
 /*******************************/
 
 command_rec wombat_commands[] = {
@@ -379,10 +414,15 @@
     AP_INIT_TAKE2("LuaConfig", register_lua_config, NULL, OR_ALL, 
                   "Perform in-Lua Configuration"),
 
-    AP_INIT_TAKE1("LuaRoot", register_lua_root, NULL, OR_ALL, 
+    AP_INIT_TAKE1("LuaDefaultCacheStyle", set_default_cache_style, NULL, RSRC_CONF, 
+                "Set the default Lua Code Cache Style."),
+
+    AP_INIT_TAKE1("LuaDefaultScope", set_default_scope, NULL, RSRC_CONF, 
+				  "Set the default Lua Code scope."),
+
+     AP_INIT_TAKE1("LuaRoot", register_lua_root, NULL, OR_ALL, 
                 "Specify the base path for resolving relative paths for mod_wombat directives"),
 
-    
     AP_INIT_TAKE1("LuaPackagePath", register_package_dir, NULL, OR_ALL, 
                   "Add a directory to lua's package.path"),
                   
@@ -458,7 +498,8 @@
     apr_thread_rwlock_create(&cfg->vm_reslists_lock, p);
     cfg->code_cache->pool = p;
     cfg->root_path = NULL;
-    
+    cfg->default_cache_style = APW_CODE_CACHE_STAT;
+    cfg->default_scope = APW_SCOPE_ONCE;
     return cfg;
 }
 
Index: mod_wombat.h
===================================================================
--- mod_wombat.h	(revision 534949)
+++ mod_wombat.h	(working copy)
@@ -92,6 +92,9 @@
 
     // value of the LuaRoot directive
     const char *root_path;    
+
+    int default_cache_style;
+    int default_scope;
 } apw_server_cfg;
 
 typedef struct {
