symfony-cmf/RoutingAutoBundle — pull request #78 by WouterJ (2014-03-17 12:41:13+00:00)
Title: [WIP] Implement caching

This implemention follows somewhat the same approach as used by the Validator component (which is, if you take a look at the metadata loading, almost equal to the RoutingAutoBundle).

Instead of loading all metadata into the `MetadataFactory`, it nows gets a `MetadataDriver` instance and a Cache implementation. The `MetadataDriver` contains all the resources and the mapping loader. While the mapping loaders is resource-based, the `MetadataDriver` is class-based. It lazy loads the mapping loaders when it is asked for configuration. After that, all loaded metadatas are stored in memory.

The `MetadataFactory` on his side tries to get the object from the Cache, if that fails, it'll use the `MetadataDriver` to load the metadata and caches it afterwards. It'll always check if the metadata is fresh and will update the cache if this is not the case.

Todo
---

- [ ] Add configuration
- [ ] Remove `MetadataFactoryBuilder`
- [ ] Improve cache update mechism (it's not really updated now if some old metadata is loaded from the cache)