Favicon

Lets add a favicon to our application using the connect.favicon middleware. From a performance perspective, this has some value as we can cache it. Also, your browser will request a favicon even if one does not exist, and this can result in 404 errors being thrown. We will use the existing staticCache config value to set maxAge for the favicon. Let's edit the Express server, /vision-web/lib/express/index.js, and add the favicon middleware:

app.set('views', 'views');
app.use(express.favicon('public/components/vision/favicon.ico'), { maxAge: config.get('express:staticCache') });

Minification

We can improve page load time by minifying our static assets. We will minify our JavaScript and CSS files by installing the following two grunt tasks: ...

Get Advanced Express Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.