Express middleware to statically cache renders as HTML in your public folder, optimized through critical and html-minifier.
npm i opticache --save
const express = require('express');
const opticache = require('opticache');
const app = express();
// Add Express static folder
app.use(express.static('public'));
// Add Opticache to all routes (can be added individually too)
app.use(opticache({
public: 'public',
}));
public
- The public folder that Express serves as a staticminify
- html-minifer configuration options