Open bennypowers opened 3 years ago
What about something like this:
import { cachePlugin } from '@web/dev-server-cache';
export default {
plugins: [
cachePlugin({
rules: [
{ type: 'stale-while-revalidate', pattern: '**/*/node_modules/**/*' }
]
}),
]
}
We could use the
Cache-Control: stale-while-revalidate
header to improve performance of subsequent reloads of the dev-serverhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Extension_Cache-Control_directives
https://web.dev/stale-while-revalidate/
This should initially be implemented as a plugin. After gathering use cases and feedback, we can evaluate adding it by default.