Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`web`.`client`.`HostnameCachingHTTPSPolicy``

class documentation

`class HostnameCachingHTTPSPolicy: (source)`

Implements interfaces: `twisted.web.iweb.IPolicyForHTTPS`

View In Hierarchy

IPolicyForHTTPS that wraps a `IPolicyForHTTPS` and caches the created `IOpenSSLClientConnectionCreator`.

This policy will cache up to `cacheSize` `client connection creators` for reuse in subsequent requests to the same hostname.

Present Since
Twisted 19.2.0

Method | `__init__` | No summary
Method | `creatorForNetloc` | Create a `client connection creator` for a given network location and cache it for future use.
Instance Variable | `_cache` | A cache associating hostnames to their `client connection creators`.
Instance Variable | `_cacheSize` | See `cacheSize` parameter of `__init__`.
Instance Variable | `_policyForHTTPS` | See `policyforHTTPS` parameter of `__init__`.

def __init__(self, policyforHTTPS, cacheSize=20): (source)

Parameters
policyforHTTPS:`IPolicyForHTTPS` | The IPolicyForHTTPS to wrap.
cacheSize:`int` | The maximum size of the hostname cache.

def creatorForNetloc(self, hostname, port): (source)
from `twisted.web.iweb.IPolicyForHTTPS`

Create a `client connection creator` for a given network location and cache it for future use.

Parameters
hostname:`bytes` | The hostname part of the URI.
port:`int` | The port part of the URI.
Returns
`client connection creator` | a connection creator with appropriate verification restrictions set

_cache: `collections.OrderedDict` = (source)

A cache associating hostnames to their `client connection creators`.

_cacheSize = (source)

See `cacheSize` parameter of `__init__`.

_policyForHTTPS = (source)

See `policyforHTTPS` parameter of `__init__`.