Closed drzraf closed 3 years ago
I wouldn't clear all the cache, I'd just invalidate it causing recalcs.
Sample case: I updated the a form field and pushed. After git-sync pulled, the public (cached) page's form wasn't updated.
Changing twig is a special case, it always needs twig cache clear.
I don't think git sync should be the one in charge of making the decision about clearing cache or not. Clearing cache follows a flow that rarely you want to disrupt. Either cache expires naturally or user manually forces the clearing. Plugins that automatically clear cache are rare and they really need to have obvious reasons for that, I don't think GitSync should be in charge of this.
However, you could totally hook into GitSync gitsync
event and manually trigger a Cache Clear. That would fall under the 'user manually forcing a clear cache' category. If you had it as a very simple plugin, then you could transport this project to project depending on the need.
I agree. There's no way to know what is being synced and large changing sites may become unusable if you clear too much of the cache on every pull.
Happens that after a pull, cache is not cleared which is a problem for cache-enabled Grav instances.