Skip to content

Commit

Permalink
Add small note for using the cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
lennerd committed Oct 24, 2017
1 parent 330b620 commit b35c10c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -35,6 +35,18 @@ $detector = new BotDetector($loader, $metadataFile);
$bot = $detector->detect($agent, $ip);
```

**Note:** To greatly improve performance, `BotDetector` has a built in cache, which can be used to speed up parsing and loading of metadata.

``` php
# Instantiate a BotDetector with additional options.
$detector = new BotDetector($loader, $metadataFile, [
'debug' => $debug,
'cache_dir' => '/acme/cache',
]);
```

Via additional options `metadata_cache_file` and `metadata_dumper_class` you can further control how cache files are named or generated.

## ToDo's

- Add additional meta data loaders (xml, php)
Expand Down

0 comments on commit b35c10c

Please sign in to comment.