Skip to content

Instantly share code, notes, and snippets.

@khoa-le
Last active May 21, 2016 03:11
Show Gist options
  • Select an option

  • Save khoa-le/a950260308a4c8dae90b78b7f13e80a6 to your computer and use it in GitHub Desktop.

Select an option

Save khoa-le/a950260308a4c8dae90b78b7f13e80a6 to your computer and use it in GitHub Desktop.
Action to pure cache from gateway in symfony
<?php
/**
* @param Request $request
* @param string $subdomain
* @return Response
*/
public function purecacheAction(Request $request, $subdomain)
{
$servers = array('127.0.0.1'); // Port 80 assumed for 10.0.0.1
$client = new Symfony($servers, 'http://your-url.com');
$client->purge('/')->flush();
return new Response();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment