<commit_before>.. _configuration:

**********************
Advanced configuration
**********************

While no specific configuration is needed to run ``html5-appcache``, you can
customize its behavior for your own needs with the following parameters:

.. setting:: HTML5_APPCACHE_DISABLE

HTML5_APPCACHE_DISABLE
======================

If you want to keep ``django-html5-appcache`` installed but you want to disable
it temporarely (for debug purposes, for example), set this parameter to ``True``:
it makes the manifest view return a non-caching manifest file and disables ``appcache_link``
templatetag.

.. versionadded:: 0.3.0

*Defaults*: ``False``

.. setting:: HTML5_APPCACHE_ADD_WILDCARD

HTML5_APPCACHE_ADD_WILDCARD
===========================
If ``True`` a wildcard entry is added in network section to allow browser to
download files not in the ``CACHE`` section.

.. versionadded:: 0.3.0

*Defaults*: ``True``

.. setting:: HTML5_APPCACHE_CACHE_KEY

HTML5_APPCACHE_CACHE_KEY
========================

Name of the cache key.

*Defaults*: ``html5_appcache``

.. setting:: HTML5_APPCACHE_CACHE_DURATION

HTML5_APPCACHE_CACHE_DURATION
=============================

Duration of the cache values.

*Default*: ``86400`` seconds

.. setting:: HTML5_APPCACHE_USE_SITEMAP

HTML5_APPCACHE_USE_SITEMAP
==========================

``django-html5-appcache`` can leverage the ``sitemap`` application of django to
discover the cacheable urls. If you want to disable, you must provide a urls list.

*Default*: ``True``

.. setting:: HTML5_APPCACHE_CACHED_URL

HTML5_APPCACHE_CACHED_URL
=========================

It's possible to provide a list of urls to include in the manifest file as cached
urls, if it's not discoverable by the django application (e.g.: it's not managed
by django or not linked to any page).

*Default*: ``[]``

.. setting:: HTML5_APPCACHE_EXCLUDE_URL

HTML5_APPCACHE_EXCLUDE_URL
==========================

It's possible to exclude specific url from being cached by using this parameter.
Contrary to :setting:`HTML5_APPCACHE_NETWORK_URL` URLs will be excluded by
cached urls but are **not** set in the **NETWORK** section of the manifest.
This way you can mask out *private* URLs or URLs that are not meant to be known.

.. warning::
    This is **not** a security feature. *Security through obscurity* is broken
    by design. This parameter is intended only to have a cleaner and more concise
    manifest.

.. versionadded:: 0.3.2

*Default*: ``[]``<commit_msg>Fix documentation<commit_after>.. _configuration:

**********************
Advanced configuration
**********************

While no specific configuration is needed to run ``html5-appcache``, you can
customize its behavior for your own needs with the following parameters:

.. setting:: HTML5_APPCACHE_DISABLE

HTML5_APPCACHE_DISABLE
======================

If you want to keep ``django-html5-appcache`` installed but you want to disable
it temporarely (for debug purposes, for example), set this parameter to ``True``:
it makes the manifest view return a non-caching manifest file and disables ``appcache_link``
templatetag.

.. versionadded:: 0.3.0

*Defaults*: ``False``

.. setting:: HTML5_APPCACHE_ADD_WILDCARD

HTML5_APPCACHE_ADD_WILDCARD
===========================
If ``True`` a wildcard entry is added in network section to allow browser to
download files not in the ``CACHE`` section.

.. versionadded:: 0.3.0

*Defaults*: ``True``

.. setting:: HTML5_APPCACHE_CACHE_KEY

HTML5_APPCACHE_CACHE_KEY
========================

Name of the cache key.

*Defaults*: ``html5_appcache``

.. setting:: HTML5_APPCACHE_CACHE_DURATION

HTML5_APPCACHE_CACHE_DURATION
=============================

Duration of the cache values.

*Default*: ``86400`` seconds

.. setting:: HTML5_APPCACHE_USE_SITEMAP

HTML5_APPCACHE_USE_SITEMAP
==========================

``django-html5-appcache`` can leverage the ``sitemap`` application of django to
discover the cacheable urls. If you want to disable, you must provide a urls list.

*Default*: ``True``

.. setting:: HTML5_APPCACHE_CACHED_URL

HTML5_APPCACHE_CACHED_URL
=========================

It's possible to provide a list of urls to include in the manifest file as cached
urls, if it's not discoverable by the django application (e.g.: it's not managed
by django or not linked to any page).

*Default*: ``[]``

.. setting:: HTML5_APPCACHE_EXCLUDE_URL

HTML5_APPCACHE_EXCLUDE_URL
==========================

It's possible to exclude specific url from being cached by using this parameter.
Contrary to :setting:`HTML5_APPCACHE_NETWORK_URL` URLs will be excluded by
cached urls but are **not** set in the **NETWORK** section of the manifest.
This way you can mask out *private* URLs or URLs that are not meant to be known.

.. warning::
    This is **not** a security feature. *Security through obscurity* is broken
    by design. This parameter is intended only to have a cleaner and more concise
    manifest.

.. versionadded:: 0.4

*Default*: ``[]``
{'fraction_non_alphanumeric': 0.16914722445695898, 'fraction_numerical': 0.013073209975864843, 'mean_word_length': 5.351213282247765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5190407', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1465, 'n_words': 549}