.. include:: /Includes.rst.txt .. _feature-100887-1773012077: =========================================================== Feature: #100887 - Prefer CSP hash values over nonce values =========================================================== See :issue:`100887` Description =========== Content-Security-Policy nonce values are random tokens in each request that prevent HTTP response caching. By collecting hash values of assets at render time instead, responses can be cached, for example by using :composer:`lochmueller/staticfilecache` or reverse proxies, while still enforcing a strict CSP. Hash-based CSP is an explicit opt-in configured for a site via :file:`csp.yaml`. Nonce values remain the default when no behavior is configured. New `DirectiveHashCollection` service ------------------------------------- The new :php:`\TYPO3\CMS\Core\Security\ContentSecurityPolicy\DirectiveHashCollection` service is a per-request registry that collects CSP hash values for inline and static assets during page rendering. Both inline content and static file resources are supported: * Inline assets: the SHA-256 hash is computed over the content that appears inside the :html:`