Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redis clear #2355

Draft
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

kyletaylored
Copy link
Contributor

@kyletaylored kyletaylored commented Apr 1, 2022

There is a Redis cache clear option available in the platform, but it is not yet exposed as a command within Terminus. This will add a new redis:clear command that runs on an environment.

In addition, this also adds Varnish as an option when clearing the cache as right now we only clear the framework cache (ie, drush cr or wp cache flush).

*
* @usage <site>.<env> Clears caches for <site>'s <env> environment.
*
* @throws \Pantheon\Terminus\Exceptions\TerminusProcessException
* @throws \Pantheon\Terminus\Exceptions\TerminusException
*/
public function clearCache($site_env)
public function clearCache($site_env, $options = ['framework_cache' => true, 'varnish_cache' => false,])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 on adding flags to the existing env:cc command. Note that it's not reliable to turn off the varnish cache here, as the Drupal hook will clear the varnish cache even if the ygg workflow does not.

The existing behavior may be inconsistent with WordPress, i.e. WordPress might not clear the varnish cache if the ygg workflow does not. Ideally we would fix WordPress, and hook its cache clear operation the same way we do for Drupal. Maybe having ygg clear the varnish cache invariantly here would be a reasonable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants