I've been trying to get code chunk cache invalidation to work based on a global variable (which will eventually be a string with a `digest` hash of several my data set. For now, I would be content with the following.

In code chunk 1, I set `my_variable`:

```r
my_variable <- "a"
```

Then in code chunk B, I do a plot, that gets cached, unless I change the value of `my_variable` in code chunk 1:
```r
#| cache: true
#| cache-vars: my_variable
#| cache-globals: my_variable
#| autodep: true

ggplot(...)
````

I've been trying around various combination of the chunk settings using the new Quarto syntax. But none of the combinations seems to trigger a refresh of the cached chunk.

An immediate solution would be to have an example here, but even better would be if the documentation (for example at https://quarto.org/docs/reference/cells/cells-knitr.html#cache ) could be a bit clearer on how to achieve this.



cderv
2022-08-13T19:19:51Z
torfason
documentation
Future
open
Provide examples of chunk cache invalidation
https://github.com/quarto-dev/quarto-cli/issues/1872