Open stuartcusackie opened 1 year ago
How we tend to handle this is using a NavSaved listener, then Artisan::call('statamic:static:warm)
You can do this using the UrlInvalidated event: https://github.com/statamic/cms/pull/8902
Cool, I think I have a similar solution implemented, but I think this should be a core feature, maybe.
Going by the conversation around that issue and the one linked to it, I think this is the solution.
Thank you, I will try that out!
Your listener example here works perfectly. I made it a queueable listener due to the number of entries on my site. Thank you!
It seems to me that the static cache should be automatically warmed again after it is cleared.
For example, if I make changes to my 'primary' nav then the entire static cache is cleared. Rules:
So now nothing is cached and the website is slow. I have to manually run
static:warm
but usually I am unaware when my clients make changes to the navs. The same applies to globals.I think this should be done automatically after any entry's static cache is cleared. It might be complicated because we may want to queue the warming, so I guess this would have to be an optional feature.
Thanks.