Skip to content

Commit e1f4198

Browse files
committed
Add docs
1 parent 70ece1c commit e1f4198

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/web3.eth.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,18 @@ The following properties are available on the ``web3.eth`` namespace.
216216
>>> web3.eth.chain_id
217217
61
218218
219+
.. note::
220+
221+
This property gets called frequently in validation middleware,
222+
but `chain_id` is added to the ``simple_cache_middleware`` by default.
223+
Add the :meth:`simple_cache_middleware<web3.middleware.construct_simple_cache_middleware>`
224+
to the ``middleware_onion`` to increase performance:
225+
226+
.. code-block:: python
227+
228+
>>> from web3.middleware import simple_cache_middleware
229+
>>> w3.middleware_onion.add(simple_cache_middleare)
230+
219231
220232
.. py:attribute:: Eth.chainId
221233

0 commit comments

Comments
 (0)