Add cache.close to README

This commit is contained in:
Tobe O 2018-04-01 22:02:56 -04:00
parent 21f9c98687
commit 205d654cca

View file

@ -30,6 +30,9 @@ Future configureServer(Angel app) async {
// You can also pass an invalidation timeout. // You can also pass an invalidation timeout.
var cache = new ResponseCache(timeout: const Duration(days: 2)); var cache = new ResponseCache(timeout: const Duration(days: 2));
// Close the cache when the application closes.
app.shutdownHooks.add((_) => cache.close());
// Use `patterns` to specify which resources should be cached. // Use `patterns` to specify which resources should be cached.
cache.patterns.addAll([ cache.patterns.addAll([
'robots.txt', 'robots.txt',