2009-05-14 grizzly-sendfile 0.3 is out!
2009-05-10 grizzly-sendfile and Comparison of Blocking and NonBlocking IO
2009-02-05 Project Announcement
The goal of this extension is to facilitate an efficient file transfer functionality, which would allow applications to delegate file transfers to the application server, while retaining control over which file to send, access control or any other application specific logic.
The name comes from the X-Sendfile HTTP header that is used to send instructions between the application and the extension. X-Sendfile is already supported by many web servers e.g. Apache, Lighttpd, but is unfortunately is not commonly used by JavaEE application servers.
grizzly-sendfile 0.2 is compatible with grizzly 1.0.x (used in GlassFish 2.0 and 2.1). The soon to be released 0.3 version is compatible with grizzly 1.9.15+ (used in GlassFish v3b48+).
grizzly-sendfile extension is an ideal solution when you want to:
- add file sending functionality to an application
- control access to files via custom authentication and authorization in your application
- allow http clients to access files that are not directly accessible by the app/web server
- simply send files wickedly fast to many clients
- decouples the file sending logic from the application logic
- optimized for speed and scalability
- significantly reduces memory consumption of the application server
- downloads are handled separately from regular http traffic, allowing application to be responsive even when there are many downloads in progress
- JMX instrumentation for runtime monitoring
- extensible via plugins
- works with any application written in any language or using any framework supported by GlassFish/grizzly
Getting started with grizzly-sendfile is pretty easy.
- Configure your grizzly or GlassFish server.
- In your application, instead of generating any kind of response content, just set "X-Sendfile" response header with a value corresponding to the file you want grizzly-sendfile to send to the user.
For example in a JSP page or servlet you can simply do this:
send_file '/path/to.png', :x_sendfile => true, :type => 'image/png'
That's it... there is no step #3. When this code is executed the response will be intercepted by grizzly-sendfile and the file will be efficiently transferred to the client.
grizzly-sendfile is currently powering:
If your app is powered by grizzly-sendfile, let me know!