On Fri, Aug 3, 2012 at 5:16 PM, Tim Caswell <t...@creationix.com> wrote:Actually it's just one file that needs *caching* and *compression*:
> What kind of caching do you want?
The other files are just exposed for development (process.env.NODE_ENV
And, then I want to provide Socket.IO. Fortunately, the Socket.IO module
What is all this? It's an API that users interface with via an object
The contents of the directory `script` are a bunch of AMD modules. They
> And are you also talking about conditional http requests (Etag,Nothing complicated - see above. No redirects, no error page, etc.
> timestamps, 304 responses)? What about range request support?
> A simple filter in front of any off-the-shelf static file serverI don't want to use a separate file server.
> should five you 95% of what you want.
> var staticHandler = require('creationix').static("/", __dirname);Looks interesting! Reading the source of `static()`...
> Then you'll mount / -> / but only if it ends in ".js" and is notThere are more files that I don't want to serve in `/`. In fact, for
security reasons, I don't want to mount `/` at all...
> If you don't mind caching your files in memory, then just read theI see. That's a start for `xyz.js`. I could just use `fs.watchFile`.
> files to ram (either at startup or on demand) and watch the files for
> changes (if you want to pick up changes) to invalidate your cache.
Then I also need to think about compression. But perhaps the Nodejitsu
folks take care of that.
> Don't fall into the trap of using a large library that only does 50%OTOH I don't have any special requirements, and so writing my own static
> of what you [...]
file serving code - while surely instructional - seems like reinventing
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.