@@ -21,15 +21,42 @@ How Does Caching Work?
21
21
22
22
Caching can be enabled on a per-page basis, and you can set the length
23
23
of time that a page should remain cached before being refreshed. When a
24
- page is loaded for the first time, the file will be cached using the
25
- currently configured cache engine. On subsequent page loads, the cache file
24
+ page is loaded for the first time, the page will be cached using the
25
+ currently configured cache engine. On subsequent page loads, the cache
26
26
will be retrieved and sent to the requesting user's browser. If it has
27
27
expired, it will be deleted and refreshed before being sent to the
28
28
browser.
29
29
30
30
.. note :: The Benchmark tag is not cached so you can still view your page
31
31
load speed when caching is enabled.
32
32
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
+
33
60
Enabling Caching
34
61
================
35
62
@@ -46,15 +73,12 @@ the order that it appears, so place it wherever it seems most logical to
46
73
you. Once the tag is in place, your pages will begin being cached.
47
74
48
75
.. important :: If you change configuration options that might affect
49
- your output, you have to manually delete your cache files.
50
-
51
- .. note :: Before the cache files can be written you must set the cache
52
- engine up by editing **app/Config/Cache.php **.
76
+ your output, you have to manually delete your cache.
53
77
54
78
Deleting Caches
55
79
===============
56
80
57
- If you no longer wish to cache a file you can remove the caching tag and
81
+ If you no longer wish to cache a page you can remove the caching tag and
58
82
it will no longer be refreshed when it expires.
59
83
60
84
.. note :: Removing the tag will not delete the cache immediately. It will
0 commit comments