Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-06 Thread P. Douglas Reeder
IIRC, "hard" directives (Expires and cache-control: max-age) take effect before "soft" directives such as cache-control: no-cache (which actually means something like "validate before returning cached copy". If a response is "fresh", the user agent will not make any request, and if you don't set

[nodejs] Re: Serving static files, but not from public directory?

2012-08-06 Thread Abramovick
I am in a similar situation as yours. Thanks to the guy who suggested node-filecache, because, it worked like a charm. N thanks to the guy who suggested lactate too. Although I couldnt get my head around lactate. The Documentation was poor because it was tied down to Express. But anyways, once

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-06 Thread Felix E. Klee
On Mon, Aug 6, 2012 at 6:15 AM, tjholowaychuk wrote: > Don't cache with node, slap varnish in front I wonder whether Nodejitsu is using something like that. And I wonder how Varnish will know whether a file has changed and its cache needs to be updated. With `Cache-Control: no-cache`, I assume V

[nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread tjholowaychuk
Though if you are going to cache with node you'll have to do a better job than the hack I did with staticCache(), node-static does it extremely wrong and will give you stale responses and invalid ones at times depending on the request On Sunday, 5 August 2012 21:14:37 UTC-7, tjholowaychuk wrote:

[nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread tjholowaychuk
Don't cache with node, slap varnish in front On Friday, 3 August 2012 07:46:37 UTC-7, Felix E. Klee wrote: > > What is a good module to serve some static (JavaScript) files (including > caching and compression)? > > Desired mapping of files to URLs: > > scripts/*.js -> http://example.com/scri

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Felix E. Klee
On Sun, Aug 5, 2012 at 5:19 PM, Oliver Leics wrote: > https://github.com/oleics/node-filecache/blob/master/examples/server.js This looks really cool! Haven't tried it out in my own project, yet, though. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wi

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Oliver Leics
On Sun, Aug 5, 2012 at 11:38 AM, Oliver Leics wrote: > On Sun, Aug 5, 2012 at 11:31 AM, Felix E. Klee wrote: >> On Sun, Aug 5, 2012 at 1:23 AM, Oliver Leics >> wrote: >>> Maybe it is useful for you. >> >> Thanks - looks definitely interesting, although for serving files still >> a lot of code ha

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Oliver Leics
On Sun, Aug 5, 2012 at 11:31 AM, Felix E. Klee wrote: > On Sun, Aug 5, 2012 at 1:23 AM, Oliver Leics > wrote: >> Maybe it is useful for you. > > Thanks - looks definitely interesting, although for serving files still > a lot of code has to be written. The code to serve files is in examples/serve

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Felix E. Klee
On Sun, Aug 5, 2012 at 1:23 AM, Oliver Leics wrote: > Maybe it is useful for you. Thanks - looks definitely interesting, although for serving files still a lot of code has to be written. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-04 Thread Oliver Leics
Hallo Felix, have a look at https://github.com/oleics/node-filecache for a simple in-memory filecache designed for node.js http servers. See https://github.com/oleics/node-filecache/blob/master/examples/server.js for a example of a http-server for static files that supports browser-cache-control,

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-04 Thread Weltschmerz
Lactate doesn't set Cache-Control or Expires headers by default. It also doesn't cache in memory by default (but I'm considering to change that). As for custom 404 handlers, I think that's a great idea. I'll work on it tomorrow, thanks. On Saturday, August 4, 2012 10:14:02 AM UTC-5, Felix E. K

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-04 Thread Felix E. Klee
I'm testing Lactate now. Questions and remarks: * How do I disable client (browser) side caching? Without the `expires` option being set, just no `Cache-Control` header is returned. Is that enough? In general I though that something as the following is required: Cache-Cont

[nodejs] Re: Serving static files, but not from public directory?

2012-08-04 Thread Weltschmerz
I've added some examples for plain-jane node.js. The conversion is very simple. On Friday, August 3, 2012 9:46:37 AM UTC-5, Felix E. Klee wrote: > > What is a good module to serve some static (JavaScript) files (including > caching and compression)? > > Desired mapping of files to URLs: > >

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-04 Thread Felix E. Klee
On Sat, Aug 4, 2012 at 8:41 AM, Weltschmerz wrote: > You can do this with Lactate > > https://github.com/Weltschmerz/Lactate Looks interesting! It would be nice, though, if the examples were not Express specific. As many others, I am using plain Node.js. -- Job Board: http://jobs.nodejs.org/ Po

[nodejs] Re: Serving static files, but not from public directory?

2012-08-03 Thread Weltschmerz
You can do this with Lactate https://github.com/Weltschmerz/Lactate On Friday, August 3, 2012 9:46:37 AM UTC-5, Felix E. Klee wrote: > > What is a good module to serve some static (JavaScript) files (including > caching and compression)? > > Desired mapping of files to URLs: > > scripts/*.j