You need to set the appropriate cache control headers for the client to know that it doesn't even need to make a conditional request.
Here's a decent write up on the relevant headers themselves: https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers ~Ryan On Thu, 18 Jun 2015 at 08:46 'Kevin Ingwersen (Ingwie Phoenix)' via nodejs < nodejs@googlegroups.com> wrote: > Hey there, guys! > > I am struggling, trying to get caching right on my server. I currently use > the „st“ module for serving static files to my client. But now I want to > add the correct headers to it. The thing is, that when using ETag headers, > the client always does a verification request… and that sucks. I want to do > as few requests as possible. > > The current state of it all can be tested here http://dev.dragonsinn.tk and > the code that builds up the web server > http://git.ingwie.me/ingwie/bird3/blob/master/node-lib/front-end/request_handler.js > > Can anyone recommend a good aproach for doing proper caching? I plan on > setting up a varnish cache in the long run, but i want to only use NodeJS > for now. > > Kind regards, Ingwie > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to nodejs+unsubscr...@googlegroups.com. > To post to this group, send email to nodejs@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/8C173AF7-E6D1-4FCC-9B0D-C713BCB40CD9%40googlemail.com > <https://groups.google.com/d/msgid/nodejs/8C173AF7-E6D1-4FCC-9B0D-C713BCB40CD9%40googlemail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAGjmZGwKA4YiGRt1xehFp4hBfy76SWntBZ8TLELkcQoB0K%2BRVg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.