Prev | Current Page 156 | Next

Brad Ediger

"Advanced Rails"

Having X-Sendfile unnecessarily
enabled is a security risk, as it allows a server application to send any file that the
web server can access to the client.
To my knowledge, there is no way to use X-Sendfile on Apache 1.3 at this time.
* http://celebnamer.celebworld.ws/stuff/mod_xsendfile/
Large/Binary Objects | 107
Serving Static Files
One advantage of filesystem storage is that as long as the file data doesn??™t need to be
protected with access control or otherwise acted upon dynamically, you can leverage
your static web servers to serve that data. By exporting the storage path via NFS (or a
caching filesystem such as AFS to conserve bandwidth), you can share the application??™s
files with the static servers on your content distribution network. This completely
removes the load from the application servers and provides a more scalable
solution.
Managing Uploads in Rails
Most applications that use large objects must deal with uploads. This can be tricky in
any framework, but Rails handles most of the details and there are some best practices
to guide you with the rest.
Attachment plugins
One of the easiest ways to handle Rails uploads is to use one of the popular plugins for
upload processing. The standard plugin used to be Rick Olson??™s acts_as_attachment
(http://svn.techno-weenie.net/projects/plugins/acts_as_attachment/). Many Rails developers
are familiar with its interface, and for quite a while it was the standard way to
handle uploaded data.


Pages:
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168