Skip to content

Commit a98b6f0

Browse files
committed
docs: add "Configuring Caching"
1 parent 4823409 commit a98b6f0

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

user_guide_src/source/general/caching.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,33 @@ browser.
3030
.. note:: The Benchmark tag is not cached so you can still view your page
3131
load speed when caching is enabled.
3232

33+
Configuring Caching
34+
===================
35+
36+
Setting Cache Engine
37+
--------------------
38+
39+
Before using Web Page Caching, you must set the cache engine up by editing
40+
**app/Config/Cache.php**. See :ref:`libraries-caching-configuring-the-cache`
41+
for details.
42+
43+
Setting $cacheQueryString
44+
-------------------------
45+
46+
You can set whether or not to include the query string when generating the cache
47+
with ``Config\Cache::$cacheQueryString``.
48+
49+
Valid options are:
50+
51+
- ``false``: (default) Disabled. The query string is not taken into account; the
52+
same cache is returned for requests with the same URI path but different query
53+
strings.
54+
- ``true``: Enabled, take all query parameters into account. Be aware that this
55+
may result in numerous cache generated for the same page over and over
56+
again.
57+
- **array**: Enabled, but only take into account the specified list of query
58+
parameters. E.g., ``['q', 'page']``.
59+
3360
Enabling Caching
3461
================
3562

@@ -48,9 +75,6 @@ you. Once the tag is in place, your pages will begin being cached.
4875
.. important:: If you change configuration options that might affect
4976
your output, you have to manually delete your cache files.
5077

51-
.. note:: Before the cache files can be written you must set the cache
52-
engine up by editing **app/Config/Cache.php**.
53-
5478
Deleting Caches
5579
===============
5680

user_guide_src/source/libraries/caching.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ You can grab an instance of the cache engine directly through the Services class
2323

2424
.. literalinclude:: caching/002.php
2525

26+
.. _libraries-caching-configuring-the-cache:
27+
2628
*********************
2729
Configuring the Cache
2830
*********************

0 commit comments

Comments
 (0)