From 7cf7da3a530aa4adf12247b14fdaa81bdaf0754c Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 5 Nov 2023 11:35:59 +0900 Subject: [PATCH] docs: add about ForceHTTPS and PerformanceMetrics --- user_guide_src/source/incoming/filters.rst | 48 +++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/incoming/filters.rst b/user_guide_src/source/incoming/filters.rst index 2c6fbb6a1973..9fcb3140145d 100644 --- a/user_guide_src/source/incoming/filters.rst +++ b/user_guide_src/source/incoming/filters.rst @@ -274,10 +274,56 @@ See :ref:`URI Routing `. Provided Filters **************** -The filters bundled with CodeIgniter4 are: :doc:`Honeypot <../libraries/honeypot>`, :ref:`CSRF `, ``InvalidChars``, ``SecureHeaders``, and :ref:`DebugToolbar `. +The filters bundled with CodeIgniter4 are: + +- ``csrf`` => :ref:`CSRF ` +- ``toolbar`` => :ref:`DebugToolbar ` +- ``honeypot`` => :doc:`Honeypot <../libraries/honeypot>` +- ``invalidchars`` => :ref:`invalidchars` +- ``secureheaders`` => :ref:`secureheaders` +- ``forcehttps`` => :ref:`forcehttps` +- ``pagecache`` => :doc:`PageCache <../general/caching>` +- ``performance`` => :ref:`performancemetrics` .. note:: The filters are executed in the order defined in the config file. However, if enabled, ``DebugToolbar`` is always executed last because it should be able to capture everything that happens in the other filters. +.. _forcehttps: + +ForceHTTPS +========== + +.. versionadded:: 4.5.0 + +This filter provides the "Force Global Secure Requests" feature. + +If you set ``Config\App:$forceGlobalSecureRequests`` to true, this will force +every request made to this application to be made via a secure connection (HTTPS). +If the incoming request is not secure, the user will be redirected to a secure +version of the page and the HTTP Strict Transport Security (HSTS) header will be +set. + +.. _performancemetrics: + +PerformanceMetrics +================== + +.. versionadded:: 4.5.0 + +This filter provides the pseudo-variables for performance metrics. + +If you would like to display the total elapsed time from the moment CodeIgniter +starts to the moment right before the final output is sent to the browser, +simply place this pseudo-variable in one of your view:: + + {elapsed_time} + +If you would like to show your memory usage in your view files, use this +pseudo-variable:: + + {memory_usage} + +If you don't need this feature, remove ``'performance'`` from ``$required['after']``. + .. _invalidchars: InvalidChars