Replies: 2 comments 4 replies
-
What exactly do you mean by that? Are you thinking that would be set to a condition? {% cache recreate craft.app.request.getQueryParam('refresh') == 'true' %} Not sure I love that syntax. Maybe this makes more sense as a return [
'components' => [
'templateCaches' => [
'regenerateAllCaches' => fn() => Craft::$app->request->getBodyParam('refresh') === 'true',
],
],
]; |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if I understand you: Would the suggested solution in My preference would still be an option on the
But at the end, both solutions do the job. |
Beta Was this translation helpful? Give feedback.
-
Hi!
We currently have a scenario where we want to recreate/refresh the content of a
{% cache %}
tag without losing its cache first. With losing the cache I mean either by timing it out or by clearing the cache manually.The idea was to call a page's URL with a
refresh=true
GET param or even better a certain http header and the{% cache %}
tag would not check if it has a cached content but simple enforce cache recreation. It's important to understand that this can not be achieved with theif/unless
parameters, as they disable the cache tag completely, meaning that no cached content is stored.Our idea would be a simple
recreate
param on the{% cache %}
tag which causes this behavior.If you want to see our dirty workaround, please read this: https://craftcms.stackexchange.com/questions/41717/recreate-cache-content-without-clearing-first
Any feedback to our FR is appreciated.
Matthias
Beta Was this translation helpful? Give feedback.
All reactions