@classmethod<EOL><INDENT>def from_url(cls, url):<DEDENT>
parsed_url = urllib.parse.urlparse(url)<EOL>kwargs = dict(urllib.parse.parse_qsl(parsed_url.query))<EOL>cache_class = Cache.get_scheme_class(parsed_url.scheme)<EOL>if parsed_url.path:<EOL><INDENT>kwargs.update(cache_class.parse_uri_path(parsed_url.path))<EOL><DEDENT>if parsed_url.hostname:<EOL><INDENT>kwargs["<STR_LIT>"] = parsed_url.hostname<EOL><DEDENT>if parsed_url.port:<EOL><INDENT>kwargs["<STR_LIT:port>"] = parsed_url.port<EOL><DEDENT>if parsed_url.password:<EOL><INDENT>kwargs["<STR_LIT:password>"] = parsed_url.password<EOL><DEDENT>return Cache(cache_class, **kwargs)<EOL>
Given a resource uri, return an instance of that cache initialized with the given
parameters. An example usage:

>>> from aiocache import Cache
>>> Cache.from_url('memory://')
<aiocache.backends.memory.SimpleMemoryCache object at 0x1081dbb00>

a more advanced usage using queryparams to configure the cache:

>>> from aiocache import Cache
>>> cache = Cache.from_url('redis://localhost:10/1?pool_min_size=1')
>>> cache
RedisCache (localhost:10)
>>> cache.db
1
>>> cache.pool_min_size
1

:param url: string identifying the resource uri of the cache to connect to