Skip to content

Commit 20caec9

Browse files
committed
Merge pull request #38 from Baachi/patch-1
Improve documentation
2 parents d1ae73e + 912eddb commit 20caec9

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,31 @@ A little example:
137137
<tag name="geocoder.dumper" alias="custom" />
138138
</service>
139139
```
140+
Cache Provider
141+
---------------
142+
143+
Sometimes you have to cache the results from a provider. For this case the bundle provides
144+
a cache provider. The cache provider wraps another provider and delegate all calls
145+
to this provider and cache the return value.
146+
147+
__Configuration example:__
148+
149+
```yaml
150+
services:
151+
acme_cache_adapter:
152+
class: "Doctrine\Common\Cache\ApcCache"
153+
154+
bazinga_geocoder:
155+
providers:
156+
cache:
157+
adapter: acme_cache_adapter
158+
provider: google_maps
159+
google_maps: ~
160+
```
161+
162+
> Tip: If you want to configure the cache adapter,
163+
> we recommend the [liip/doctrine-cache-bundle](https://github.com/liip/LiipDoctrineCacheBundle.git).
164+
140165

141166

142167
Reference Configuration
@@ -191,9 +216,9 @@ bazinga_geocoder:
191216
# Caching Layer
192217
cache:
193218
provider: openstreetmaps
194-
cache: some_service_id
219+
adapter: some_service_id
195220
lifetime: 86400
196-
locale: %locale%
221+
locale: %locale%
197222
chain:
198223
providers: [free_geo_ip, host_ip]
199224
```

0 commit comments

Comments
 (0)