Last updated May 14, 2009 07:30, by Igor Minar
= The AutoSendfile Mode =
The AutoSendfile mode basically turns grizzly-sendfile into a regular webserver which listens on a specified URI prefix. When a request with this prefix arrives, grizzly-sendfile replies with a file which path matches the request URI.
Let's say that grizzly-sendfile is running in a server on port 8080 and is configure with these two options:
com.igorminar.grizzlysendfile.AutoSendfileUriPrefix=/sendfile/
com.igorminar.grizzlysendfile.AutoSendfileFileDir=/var/www/large-files/
Then <code> wget http://host:8080/sendfile/some-file.tgz</code> will result in <code>/var/www/large-files/some-file.tgz</code> to be served.
The advantages of this feature are:
* you can let grizzly-sendfile serve static files instead of using grizzly for this purpose and benefit from [[Benchmarks | grizzly-sendfile's performance, scalability]], [[Plugins | plugins]], [[JMXInstrumentation | jmx monitoring capabilities]], etc
* you can build a high performance webserver with grizzly by using only [[SettingUp | a few lines of code]]
* you can shave off a few milliseconds from the request initiation time that would otherwise be wasted in grizzly's adapters





