Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Trying to get express.compress() working
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bill  
View profile  
 More options Apr 18 2012, 4:40 pm
From: bill <b...@bunkat.com>
Date: Wed, 18 Apr 2012 13:40:58 -0700 (PDT)
Local: Wed, Apr 18 2012 4:40 pm
Subject: Trying to get express.compress() working
I'm trying to figure out how to use the staticCache(), static(), and
compress() middlewares with Express 3.0 (not specific to 3.0, never
had it working in 2.5 either).  This is what my app configuration
looks like:

app.configure(function() {
  app.use(express.favicon(__dirname + '/../public/favicon.ico',
{maxAge: 8640000000}));
  app.use(express.bodyParser());
  app.use(express.cookieParser('foo'));
  app.set('views', __dirname + '/views');
  app.engine('.html', mustache({cache: true}).render);
  app.use(express.session(
    { store: sessionStore,
      secret: 'foo'
    })
  );
  app.use(express.staticCache());
  app.use(express.static(__dirname + '/../public', {maxAge:
8640000000}));
  app.use(express.compress());

});

When I look the responses, the staticCache() always misses and my .css
and .js files are not being sent compressed. I figure the ordering is
wrong or I'm missing a setting but I can't figure it out. My routes
are defined after the app.configure() block.

Without the express.compress() line, the staticCache() starts
reporting cache hits again.

Does somebody have a sample app that uses staticCache, static, and
compress and has everything working?


 
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.