Commit b2231967 authored by Evan You's avatar Evan You

enable caching on static assets (close #150)

parent 040e0d35
...@@ -47,9 +47,9 @@ const serve = (path, cache) => express.static(resolve(path), { ...@@ -47,9 +47,9 @@ const serve = (path, cache) => express.static(resolve(path), {
app.use(compression({ threshold: 0 })) app.use(compression({ threshold: 0 }))
app.use(favicon('./public/logo-48.png')) app.use(favicon('./public/logo-48.png'))
app.use('/dist', serve('./dist')) app.use('/dist', serve('./dist', true))
app.use('/public', serve('./public')) app.use('/public', serve('./public', true))
app.use('/manifest.json', serve('./manifest.json')) app.use('/manifest.json', serve('./manifest.json', true))
app.use('/service-worker.js', serve('./dist/service-worker.js')) app.use('/service-worker.js', serve('./dist/service-worker.js'))
app.get('*', (req, res) => { app.get('*', (req, res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment