Documented the /skin endpoint

This commit is contained in:
Veloman Yunkan 2022-12-09 15:44:16 +04:00
parent 2aef2d4a92
commit 7b5b0cd7f7

View file

@ -141,6 +141,8 @@ options, respectively.
HTTP API endpoints presented below are relative to that location, i.e.
``/foo/bar`` must be actually accessed as ``http://ADDR:PORT/ROOT/foo/bar``.
.. _welcome-page:
``/``
-----
@ -276,7 +278,26 @@ Blablabla
``/skin``
-----------
Blablabla
Static front-end resources (such as CSS, javascript and images) are all grouped
under ``/skin``.
**Usage:**
``/skin/PATH/TO/RESOURCE[?cacheid=CACHEID]``
`Cache busting
<https://javascript.plainenglish.io/what-is-cache-busting-55366b3ac022>`_ of
static resources is supported via the optional param ``cacheid``. By default,
i.e. when the ``cacheid`` parameter is not specified while accessing the
``/skin`` endpoint, static resources are served as if they were dynamic (i.e.
could be different for an immediately repeated request). Specifying the
``cacheid`` parameter with a correct value (matching the value embedded in the
``kiwix-serve`` instance), makes the returned resource to be presented as
immutable. However, if the value of the ``cacheid`` parameter mismatches then
``kiwix-serve`` responds with a 404 HTTP error.
``kiwix-serve``'s default front-end (the :ref:`welcome page <welcome-page>` and
the :ref:`ZIM file viewer <zim-file-viewer>`) access all underlying static
resources by using explicit ``cacheid`` s.
``/suggest``
@ -285,6 +306,8 @@ Blablabla
Blablabla
.. _zim-file-viewer:
``/viewer``
-----------