Example #1
0
 public function testInvalidate()
 {
     $this->addCacheFile('test', 'test');
     $this->assertTrue($this->filesystem->exists($this->tmpHttpCacheDir . '/test'));
     $this->httpCacheManager->invalidateAll();
     $this->assertFalse($this->filesystem->exists($this->tmpHttpCacheDir));
 }
 public function invalidateAllAction(Request $request)
 {
     if ($request->isMethod('DELETE')) {
         $success = true;
         try {
             $this->httpCacheManager->invalidateAll();
         } catch (\Exception $e) {
             $success = false;
         }
         return new JsonResponse(array('success' => $success));
     }
     throw new NotFoundHttpException();
 }