doc/book/devweb/ajax.rst
author Philippe Pepiot <ph@itsalwaysdns.eu>
Mon, 30 Mar 2020 15:45:40 +0200
changeset 12962 fa0cd558d829
parent 12856 a82e56d4814a
permissions -rw-r--r--
[server] implement dynamic database pooler Opening too much database connection has a cost at startup and also PostgreSQL as a maximum number of connection (100 by default). This get worse when starting multiple wsgi processes, since each process has its own database pool. Instead of opening `connections-pool-size` connections to the database at startup, just open one and open more only when needed.

.. _ajax:

Ajax
----

.. warning::

    This approach is deprecated in favor of using
    `cwclientlibjs <https://www.npmjs.com/package/@logilab/cwclientlibjs>`_.
    If your use react for your UI, try the react components from the
    `cwelements <https://www.npmjs.com/package/@logilab/cwelements>`_ library.
    The documentation is kept here as reference.

    For historical reference of what Ajax is and used to be, one can read the
    `wikipedia article about Ajax <https://en.wikipedia.org/wiki/Ajax_(programming)>`_.

CubicWeb provides a few helpers to facilitate *javascript <-> python* communications.

You can, for instance, register some python functions that will become
callable from javascript through ajax calls. All the ajax URLs are handled
by the :class:`cubicweb.web.views.ajaxcontroller.AjaxController` controller.

.. automodule:: cubicweb.web.views.ajaxcontroller