1

I'll get right to it:

When running the PageSpeed tool on localhost, I'm about as optimized as I can be. When deploying that code to Azure, the max-age of the files in the public directory is ignored.

The site (nothing on it yet): http://latetotheparty.co/

My code:

app.configure(function(){
    app.use(express.logger('dev'));
    app.use(express.compress());
    app.use(express.methodOverride());
    app.use(express.static(path.join(__dirname, 'public'), {"maxAge": 30*24*60*60*1000 }));
    app.set('port', process.env.PORT || 3000);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.bodyParser());
    app.use(app.router);
});

Any thoughts on why this works locally but not once deployed? I"m pretty new to all this, and have been using it as a learning resource, but I'm not finding much detail on this particular issue. Appreciate any guidance!

EDIT not quite what I was looking for, but I managed to find a way to do it using IIS instead of node:

In web.config,

<configuration>
  <system.webServer>         
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="200:00:00" /> <!-- 200 hours max-age -->
    </staticContent>
  </system.webServer>
</configuration>

Would still appreciate any thoughts on why the node version wasn't working!

Best, Nate

4

0 回答 0