| 148 |
lars |
1 |
Caching
|
|
|
2 |
=======
|
|
|
3 |
|
|
|
4 |
Caching is used to speed up a call to [`display()`](./api-functions/api-display.md) or
|
|
|
5 |
[`fetch()`](./api-functions/api-fetch.md) by saving its output to a file. If a cached
|
|
|
6 |
version of the call is available, that is displayed instead of
|
|
|
7 |
regenerating the output. Caching can speed things up tremendously,
|
|
|
8 |
especially templates with longer computation times. Since the output of
|
|
|
9 |
[`display()`](./api-functions/api-display.md) or [`fetch()`](./api-functions/api-fetch.md) is cached, one
|
|
|
10 |
cache file could conceivably be made up of several template files,
|
|
|
11 |
config files, etc.
|
|
|
12 |
|
|
|
13 |
Since templates are dynamic, it is important to be careful what you are
|
|
|
14 |
caching and for how long. For instance, if you are displaying the front
|
|
|
15 |
page of your website that does not change its content very often, it
|
|
|
16 |
might work well to cache this page for an hour or more. On the other
|
|
|
17 |
hand, if you are displaying a page with a timetable containing new
|
|
|
18 |
information by the minute, it would not make sense to cache this page.
|
|
|
19 |
|
|
|
20 |
## Table of contents
|
|
|
21 |
- [Setting Up Caching](./caching/caching-setting-up.md)
|
|
|
22 |
- [Multiple Caches Per Page](./caching/caching-multiple-caches.md)
|
|
|
23 |
- [Controlling Cacheability of Output](./caching/caching-groups.md)
|
|
|
24 |
- [Custom Cache Implementation](./caching/caching-custom.md)
|