matsumoto-r/ngx_mruby — pull request #24 by cubicdaiya (2013-03-14 13:48:15+00:00)
Title: 'mruby_cache' is not enabled in (post_read|server_rewrite)_handler

Though I noticed that a little while ago, 'mruby_cache' is not enabled in (post_read|server_rewrite)_handler.

Even if 'mruby_cache' is set on in location context, it is not enabled in (post_read|server_rewrite)_handler. In these handlers,
'mruby_cache' must be in server context.

In detail, mruby_cache is set like following currently.

```
location /mruby {
mruby_cache on;
mruby_post_read_handler /scripts/post_read.mrb; # 'mruby_cache' is not enabled(!)
mruby_server_rewrite_handler /scripts/server_rewrite.mrb; # 'mruby_cache' is not enabled(!)
mruby_rewrite_handler /scripts/rewrite.mrb; # 'mruby_cache' is enabled
mruby_access_handler /scripts/access.mrb; # 'mruby_cache' is enabled
mruby_content_handler /scripts/content.mrb; # 'mruby_cache' is enabled
mruby_log_handler /scripts/log.mrb; # 'mruby_cache' is enabled
```

After patch this commit, if you describe 'mruby_cache on;' in server context,

```
server {
mruby_cache on;
location /mruby {
mruby_post_read_handler /scripts/post_read.mrb; # 'mruby_cache' is enabled
mruby_server_rewrite_handler /scripts/server_rewrite.mrb; # 'mruby_cache' is enabled
mruby_rewrite_handler /scripts/rewrite.mrb; # 'mruby_cache' is enabled
mruby_access_handler /scripts/access.mrb; # 'mruby_cache' is enabled
mruby_content_handler /scripts/content.mrb; # 'mruby_cache' is enabled
mruby_log_handler /scripts/log.mrb; # 'mruby_cache' is enabled
```