mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Squashed 'docs/' changes from af4b7ac5b..54f0e8776
54f0e8776 Update image-actions.yml 94e5cad02 Update image-actions.yml 0ad20d226 Add a page about Hugo's Security Model 0dee16d11 Link to Régis Full Partials series 138782808 Update partialCached.md git-subtree-dir: docs git-subtree-split: 54f0e877670fd434c6903e20774fcf7eba9255fa
This commit is contained in:
@@ -21,7 +21,6 @@ aliases: []
|
||||
|
||||
The `partialCached` template function can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation.
|
||||
|
||||
|
||||
**Note:** Each Site (or language) has its own `partialCached` cache, so each site will execute a partial once.
|
||||
|
||||
Here is the simplest usage:
|
||||
@@ -42,4 +41,7 @@ If you need to pass additional parameters to create unique variants, you can pas
|
||||
{{ partialCached "footer.html" . .Params.country .Params.province }}
|
||||
```
|
||||
|
||||
Note that the variant parameters are not made available to the underlying partial template. They are only use to create a unique cache key.
|
||||
Note that the variant parameters are not made available to the underlying partial template. They are only use to create a unique cache key. Since Hugo `0.61.0` you can use any object as cache key(s), not just strings.
|
||||
|
||||
|
||||
> See also the [The Full Partial Series Part 1: Caching!](https://regisphilibert.com/blog/2019/12/hugo-partial-series-part-1-caching-with-partialcached/)
|
||||
|
||||
Reference in New Issue
Block a user