From 4823409a4b26210aae463aa1eafaa04791c17782 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 30 Jun 2023 09:57:58 +0900 Subject: [PATCH 1/3] docs: update comment --- app/Config/Cache.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Config/Cache.php b/app/Config/Cache.php index 659d9ed6ae38..c19358ce8449 100644 --- a/app/Config/Cache.php +++ b/app/Config/Cache.php @@ -53,12 +53,12 @@ class Cache extends BaseConfig * Whether to take the URL query string into consideration when generating * output cache files. Valid options are: * - * false = Disabled - * true = Enabled, take all query parameters into account. - * Please be aware that this may result in numerous cache - * files generated for the same page over and over again. - * array('q') = Enabled, but only take into account the specified list - * of query parameters. + * false = Disabled + * true = Enabled, take all query parameters into account. + * Please be aware that this may result in numerous cache + * files generated for the same page over and over again. + * ['q'] = Enabled, but only take into account the specified list + * of query parameters. * * @var bool|string[] */ From a98b6f0e0524f2ff388a98a725b8148ddf326def Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 30 Jun 2023 10:20:26 +0900 Subject: [PATCH 2/3] docs: add "Configuring Caching" --- user_guide_src/source/general/caching.rst | 30 ++++++++++++++++++--- user_guide_src/source/libraries/caching.rst | 2 ++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/general/caching.rst b/user_guide_src/source/general/caching.rst index 04a144141ff2..64af64405026 100644 --- a/user_guide_src/source/general/caching.rst +++ b/user_guide_src/source/general/caching.rst @@ -30,6 +30,33 @@ browser. .. note:: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled. +Configuring Caching +=================== + +Setting Cache Engine +-------------------- + +Before using Web Page Caching, you must set the cache engine up by editing +**app/Config/Cache.php**. See :ref:`libraries-caching-configuring-the-cache` +for details. + +Setting $cacheQueryString +------------------------- + +You can set whether or not to include the query string when generating the cache +with ``Config\Cache::$cacheQueryString``. + +Valid options are: + +- ``false``: (default) Disabled. The query string is not taken into account; the + same cache is returned for requests with the same URI path but different query + strings. +- ``true``: Enabled, take all query parameters into account. Be aware that this + may result in numerous cache generated for the same page over and over + again. +- **array**: Enabled, but only take into account the specified list of query + parameters. E.g., ``['q', 'page']``. + Enabling Caching ================ @@ -48,9 +75,6 @@ you. Once the tag is in place, your pages will begin being cached. .. important:: If you change configuration options that might affect your output, you have to manually delete your cache files. -.. note:: Before the cache files can be written you must set the cache - engine up by editing **app/Config/Cache.php**. - Deleting Caches =============== diff --git a/user_guide_src/source/libraries/caching.rst b/user_guide_src/source/libraries/caching.rst index 39834b0121bb..671c92cdb488 100644 --- a/user_guide_src/source/libraries/caching.rst +++ b/user_guide_src/source/libraries/caching.rst @@ -23,6 +23,8 @@ You can grab an instance of the cache engine directly through the Services class .. literalinclude:: caching/002.php +.. _libraries-caching-configuring-the-cache: + ********************* Configuring the Cache ********************* From 5f5a5be3337889637f5298bc500ad67e38b23c24 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 30 Jun 2023 10:22:46 +0900 Subject: [PATCH 3/3] docs: fix descriptions --- user_guide_src/source/general/caching.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/general/caching.rst b/user_guide_src/source/general/caching.rst index 64af64405026..4d2426e30c26 100644 --- a/user_guide_src/source/general/caching.rst +++ b/user_guide_src/source/general/caching.rst @@ -21,8 +21,8 @@ How Does Caching Work? Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. When a -page is loaded for the first time, the file will be cached using the -currently configured cache engine. On subsequent page loads, the cache file +page is loaded for the first time, the page will be cached using the +currently configured cache engine. On subsequent page loads, the cache will be retrieved and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser. @@ -73,12 +73,12 @@ the order that it appears, so place it wherever it seems most logical to you. Once the tag is in place, your pages will begin being cached. .. important:: If you change configuration options that might affect - your output, you have to manually delete your cache files. + your output, you have to manually delete your cache. Deleting Caches =============== -If you no longer wish to cache a file you can remove the caching tag and +If you no longer wish to cache a page you can remove the caching tag and it will no longer be refreshed when it expires. .. note:: Removing the tag will not delete the cache immediately. It will