Add cache.close to README
This commit is contained in:
parent
21f9c98687
commit
205d654cca
1 changed files with 3 additions and 0 deletions
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue