How can I purge a specific URL from varnish cache without making a curl request? I'm programmatically updating images and keeping the same file name. I flush the image styles for the image when I do this, but I'm running into an issue where my image styles aren't being regenerated because the old image style is being loaded from varnish when the attempt to regenerate them is made. I've read (in a couple places, including this related Drupal answer How can I clear the Varnish cache?) that I can clear the cache with a curl request: 

curl -X PURGE -H "Host: domain.com" http://127.0.0.1/test.html


How can I use an existing method in the Purge or Acquia Purge modules to clear the cache for a given url, specifically an image style url?

Note: I've seen the purge_queuer_url module, but that is not a viable solution for me.

Update: I don't even think this was happening. I can't reproduce the varnish cache hits at all so I must've been wrong about that. I found a bug elsewhere with the focal_point module that was causing my image styles to not be recreated properly.
Here's some code that I use to clear Acquia varish via the Purge / Acquia purge modules when a pdf with the same name is uploaded.  You could expand on this to clear the styles cache as well.

/**
 * Implements hook_entity_update().
 */
function my_module_entity_update(EntityInterface $entity) {
  $type = $entity-&gt;getEntityTypeId();
  if ($type != 'file') {
    return;
  }
  // \Drupal::logger('my_module')-&gt;debug("File entity found");
  $purgeInvalidationFactory = \Drupal::service('purge.invalidation.factory');
  $purgeQueuers = \Drupal::service('purge.queuers');
  $purgeQueue = \Drupal::service('purge.queue');

  $queuer = $purgeQueuers-&gt;get('coretags');
  // Invalidate cache tags so all pages that have the file get banned from varnish
  // Also invalidate the file's url.
  $invalidations = [
      $purgeInvalidationFactory-&gt;get('tag', 'file:' . $entity-&gt;id()),
      $purgeInvalidationFactory-&gt;get('url', file_create_url($entity-&gt;getFileUri())),
  ];

  $purgeQueue-&gt;add($queuer, $invalidations);
}