diff --git a/src/security/certificate-cache-ttl.cpp b/src/security/certificate-cache-ttl.cpp
deleted file mode 100644
index 4ea644e..0000000
--- a/src/security/certificate-cache-ttl.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (c) 2013-2014,  Regents of the University of California.
- * All rights reserved.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * This file licensed under New BSD License.  See COPYING for detailed information about
- * ndn-cxx library copyright, permissions, and redistribution restrictions.
- *
- * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
- */
-
-#include "common.hpp"
-#include "certificate-cache-ttl.hpp"
-
-using namespace std;
-
-namespace ndn {
-
-CertificateCacheTtl::CertificateCacheTtl(shared_ptr<boost::asio::io_service> io,
-                                         const time::seconds& defaultTtl)
-  : m_defaultTtl(defaultTtl)
-  , m_scheduler(*io)
-{
-}
-
-CertificateCacheTtl::~CertificateCacheTtl()
-{
-}
-
-void
-CertificateCacheTtl::insertCertificate(shared_ptr<const IdentityCertificate> certificate)
-{
-  time::milliseconds expire = (certificate->getFreshnessPeriod() >= time::seconds::zero() ?
-                               certificate->getFreshnessPeriod() : m_defaultTtl);
-
-  Name trackerIndex = certificate->getName().getPrefix(-1);
-  EventTracker::iterator it = m_tracker.find(trackerIndex);
-  if (it != m_tracker.end())
-      m_scheduler.cancelEvent(m_tracker[trackerIndex]);
-
-  m_scheduler.scheduleEvent(time::seconds(0),
-                            bind(&CertificateCacheTtl::insert, this, certificate));
-  m_tracker[trackerIndex] = m_scheduler.scheduleEvent(expire,
-                                                      bind(&CertificateCacheTtl::remove,
-                                                           this, certificate->getName()));
-}
-
-void
-CertificateCacheTtl::insert(shared_ptr<const IdentityCertificate> certificate)
-{
-  Name name = certificate->getName().getPrefix(-1);
-  m_cache[name] = certificate;
-}
-
-void
-CertificateCacheTtl::remove(const Name& certificateName)
-{
-  Name name = certificateName.getPrefix(-1);
-  Cache::iterator it = m_cache.find(name);
-  if (it != m_cache.end())
-    m_cache.erase(it);
-}
-
-shared_ptr<const IdentityCertificate>
-CertificateCacheTtl::getCertificate(const Name& certificateName)
-{
-  Cache::iterator it = m_cache.find(certificateName);
-  if (it != m_cache.end())
-    return it->second;
-  else
-    return shared_ptr<IdentityCertificate>();
-}
-
-} // namespace ndn
diff --git a/src/security/certificate-cache-ttl.hpp b/src/security/certificate-cache-ttl.hpp
index a86ee5e..4cf20e2 100644
--- a/src/security/certificate-cache-ttl.hpp
+++ b/src/security/certificate-cache-ttl.hpp
@@ -24,35 +24,116 @@
 class CertificateCacheTtl : public CertificateCache
 {
 public:
-  CertificateCacheTtl(shared_ptr<boost::asio::io_service> io,
-                      const time::seconds& defaultTtl = time::seconds(3600));
+  CertificateCacheTtl(boost::asio::io_service& io,
+                      const time::seconds& defaultTtl = time::seconds(3600))
+    : m_defaultTtl(defaultTtl)
+    , m_scheduler(io)
+  {
+  }
 
   virtual
-  ~CertificateCacheTtl();
+  ~CertificateCacheTtl()
+  {
+  }
 
-  virtual void
+  virtual inline void
   insertCertificate(shared_ptr<const IdentityCertificate> certificate);
 
-  virtual shared_ptr<const IdentityCertificate>
+  virtual inline shared_ptr<const IdentityCertificate>
   getCertificate(const Name& certificateNameWithoutVersion);
 
+  virtual inline void
+  reset();
+
+  virtual inline size_t
+  getSize();
+
 private:
-  void
+  inline void
   insert(shared_ptr<const IdentityCertificate> certificate);
 
-  void
+  inline void
   remove(const Name& certificateName);
 
+  inline void
+  removeAll();
+
 protected:
-  typedef std::map<Name, shared_ptr<const IdentityCertificate> > Cache;
-  typedef std::map<Name, EventId> EventTracker;
+  typedef std::map<Name, std::pair<shared_ptr<const IdentityCertificate>, EventId> > Cache;
 
   time::seconds m_defaultTtl;
   Cache m_cache;
-  EventTracker m_tracker;
   Scheduler m_scheduler;
 };
 
+inline void
+CertificateCacheTtl::insertCertificate(shared_ptr<const IdentityCertificate> certificate)
+{
+  m_scheduler.scheduleEvent(time::seconds(0),
+                            bind(&CertificateCacheTtl::insert, this, certificate));
+}
+
+inline shared_ptr<const IdentityCertificate>
+CertificateCacheTtl::getCertificate(const Name& certificateName)
+{
+  Cache::iterator it = m_cache.find(certificateName);
+  if (it != m_cache.end())
+    return it->second.first;
+  else
+    return shared_ptr<IdentityCertificate>();
+}
+
+inline void
+CertificateCacheTtl::reset()
+{
+  m_scheduler.scheduleEvent(time::seconds(0),
+                            bind(&CertificateCacheTtl::removeAll, this));
+}
+
+inline size_t
+CertificateCacheTtl::getSize()
+{
+  return m_cache.size();
+}
+
+inline void
+CertificateCacheTtl::insert(shared_ptr<const IdentityCertificate> certificate)
+{
+  time::milliseconds expire = (certificate->getFreshnessPeriod() >= time::seconds::zero() ?
+                               certificate->getFreshnessPeriod() : m_defaultTtl);
+
+  Name index = certificate->getName().getPrefix(-1);
+
+  Cache::iterator it = m_cache.find(index);
+  if (it != m_cache.end())
+    m_scheduler.cancelEvent(it->second.second);
+
+  EventId eventId = m_scheduler.scheduleEvent(expire,
+                                              bind(&CertificateCacheTtl::remove,
+                                                   this, certificate->getName()));
+
+  m_cache[index] = std::make_pair(certificate, eventId);
+}
+
+inline void
+CertificateCacheTtl::remove(const Name& certificateName)
+{
+  Name name = certificateName.getPrefix(-1);
+  Cache::iterator it = m_cache.find(name);
+  if (it != m_cache.end())
+    m_cache.erase(it);
+}
+
+inline void
+CertificateCacheTtl::removeAll()
+{
+  for(Cache::iterator it = m_cache.begin(); it != m_cache.end(); it++)
+    m_scheduler.cancelEvent(it->second.second);
+
+  m_cache.clear();
+}
+
+
 } // namespace ndn
 
 #endif //NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
diff --git a/src/security/certificate-cache.hpp b/src/security/certificate-cache.hpp
index 8f2c068..c22de67 100644
--- a/src/security/certificate-cache.hpp
+++ b/src/security/certificate-cache.hpp
@@ -33,6 +33,18 @@
 
   virtual shared_ptr<const IdentityCertificate>
   getCertificate(const Name& certificateNameWithoutVersion) = 0;
+
+  virtual void
+  reset() = 0;
+
+  virtual size_t
+  getSize() = 0;
+
+  bool
+  isEmpty()
+  {
+    return (getSize() == 0);
+  }
 };
 
 } // namespace ndn
diff --git a/src/security/validator-config.cpp b/src/security/validator-config.cpp
index aa8ec27..054c843 100644
--- a/src/security/validator-config.cpp
+++ b/src/security/validator-config.cpp
@@ -32,7 +32,7 @@
   , m_certificateCache(certificateCache)
 {
   if (!static_cast<bool>(m_certificateCache))
-    m_certificateCache = make_shared<CertificateCacheTtl>(m_face.ioService());
+    m_certificateCache = make_shared<CertificateCacheTtl>(boost::ref(m_face.getIoService()));
 }
 
 void
@@ -84,6 +84,8 @@
 {
   BOOST_ASSERT(!filename.empty());
 
+  reset();
+
   if (configSection.begin() == configSection.end())
     {
       std::string msg = "Error processing configuration file";
diff --git a/src/security/validator-config.hpp b/src/security/validator-config.hpp
index a5a8af1..e22c446 100644
--- a/src/security/validator-config.hpp
+++ b/src/security/validator-config.hpp
@@ -60,6 +60,12 @@
   load(const security::conf::ConfigSection& configSection,
        const std::string& filename);
 
+  inline void
+  reset();
+
+  inline bool
+  isEmpty();
+
 protected:
   virtual void
   checkPolicy(const Data& data,
@@ -122,6 +128,26 @@
   AnchorList m_anchors;
 };
 
+inline void
+ValidatorConfig::reset()
+{
+  m_certificateCache->reset();
+  m_interestRules.clear();
+  m_dataRules.clear();
+  m_anchors.clear();
+}
+
+inline bool
+ValidatorConfig::isEmpty()
+{
+  if (m_certificateCache->isEmpty() &&
+      m_interestRules.empty() &&
+      m_dataRules.empty() &&
+      m_anchors.empty())
+    return true;
+  return false;
+}
+
 template<class Packet, class OnValidated, class OnFailed>
 void
 ValidatorConfig::checkSignature(const Packet& packet,
diff --git a/src/security/validator-regex.cpp b/src/security/validator-regex.cpp
index d84f897..c0797c7 100644
--- a/src/security/validator-regex.cpp
+++ b/src/security/validator-regex.cpp
@@ -36,7 +36,7 @@
   , m_certificateCache(certificateCache)
 {
   if (!static_cast<bool>(m_certificateCache))
-    m_certificateCache = make_shared<CertificateCacheTtl>(m_face.ioService());
+    m_certificateCache = make_shared<CertificateCacheTtl>(boost::ref(m_face.getIoService()));
 }
 
 void
diff --git a/tests-integrated/security/test-validator-config.cpp b/tests-integrated/security/test-validator-config.cpp
index 6a7ffd9..360b056 100644
--- a/tests-integrated/security/test-validator-config.cpp
+++ b/tests-integrated/security/test-validator-config.cpp
@@ -891,7 +891,77 @@
   boost::filesystem::remove(CERT_PATH);
 }
 
+BOOST_AUTO_TEST_CASE(Reset)
+{
+  KeyChain keyChain;
 
+  Name root("/TestValidatorConfig/Reload");
+  Name rootCertName = keyChain.createIdentity(root);
+  shared_ptr<IdentityCertificate> rootCert =
+    keyChain.getCertificate(rootCertName);
+  io::save(*rootCert, "trust-anchor-8.cert");
+
+  Face face;
+
+  const std::string CONFIG =
+    "rule\n"
+    "{\n"
+    "  id \"NRD Prefix Registration Command Rule\"\n"
+    "  for interest\n"
+    "  filter\n"
+    "  {\n"
+    "    type name\n"
+    "    regex ^<localhost><nrd>[<register><unregister><advertise><withdraw>]<>{3}$\n"
+    "  }\n"
+    "  checker\n"
+    "  {\n"
+    "    type customized\n"
+    "    sig-type rsa-sha256\n"
+    "    key-locator\n"
+    "    {\n"
+    "      type name\n"
+    "      regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT>$\n"
+    "    }\n"
+    "  }\n"
+    "}\n"
+    "rule\n"
+    "{\n"
+    "  id \"Testbed Hierarchy Rule\"\n"
+    "  for data\n"
+    "  filter\n"
+    "  {\n"
+    "    type name\n"
+    "    regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT><>$\n"
+    "  }\n"
+    "  checker\n"
+    "  {\n"
+    "    type hierarchical\n"
+    "    sig-type rsa-sha256\n"
+    "  }\n"
+    "}\n"
+    "trust-anchor\n"
+    "{\n"
+    "  type file\n"
+    "  file-name \"trust-anchor-8.cert\"\n"
+    "}\n";
+  const boost::filesystem::path CONFIG_PATH =
+    (boost::filesystem::current_path() / std::string("unit-test-nfd.conf"));
+
+
+  shared_ptr<ValidatorConfig> validator = shared_ptr<ValidatorConfig>(new ValidatorConfig(face));
+
+  validator->load(CONFIG, CONFIG_PATH.native());
+  BOOST_CHECK_EQUAL(validator->isEmpty(), false);
+
+  validator->reset();
+  BOOST_CHECK(validator->isEmpty());
+
+  keyChain.deleteIdentity(root);
+
+  const boost::filesystem::path CERT_PATH =
+    (boost::filesystem::current_path() / std::string("trust-anchor-8.cert"));
+  boost::filesystem::remove(CERT_PATH);
+}
 
 BOOST_AUTO_TEST_SUITE_END()
 
diff --git a/tests/security/test-certificate-cache.cpp b/tests/security/test-certificate-cache.cpp
index 11b20fb..2f8c1a2 100644
--- a/tests/security/test-certificate-cache.cpp
+++ b/tests/security/test-certificate-cache.cpp
@@ -27,12 +27,19 @@
   BOOST_CHECK_EQUAL(static_cast<bool>(cache->getCertificate(name)), cached);
 }
 
+void
+checkSize(shared_ptr<CertificateCacheTtl> cache, size_t size)
+{
+  BOOST_CHECK_EQUAL(cache->getSize(), size);
+}
+
 
 BOOST_AUTO_TEST_CASE (Ttl)
 {
-  shared_ptr<boost::asio::io_service> io = make_shared<boost::asio::io_service>();
-  shared_ptr<CertificateCacheTtl> cache = make_shared<CertificateCacheTtl>(io, time::seconds(1));
-  Scheduler scheduler(*io);
+  boost::asio::io_service io;
+  shared_ptr<CertificateCacheTtl> cache =
+    make_shared<CertificateCacheTtl>(boost::ref(io), time::seconds(1));
+  Scheduler scheduler(io);
 
   shared_ptr<IdentityCertificate> cert1 = make_shared<IdentityCertificate>();
   Name certName1("/tmp/KEY/ksk-1/ID-CERT/1");
@@ -49,15 +56,33 @@
   cache->insertCertificate(cert1);
   cache->insertCertificate(cert2);
 
-  scheduler.scheduleEvent(time::milliseconds(200),  bind(&getCertificateTtl, cache, name1, true));
-  scheduler.scheduleEvent(time::milliseconds(200),  bind(&getCertificateTtl, cache, name2, true));
-  scheduler.scheduleEvent(time::milliseconds(900),  bind(&getCertificateTtl, cache, name1, false));
-  scheduler.scheduleEvent(time::milliseconds(900),  bind(&getCertificateTtl, cache, name2, true));
-  scheduler.scheduleEvent(time::milliseconds(900),  bind(&CertificateCache::insertCertificate, cache, cert2));
+  scheduler.scheduleEvent(time::milliseconds(200), bind(&checkSize, cache, 2));
+  scheduler.scheduleEvent(time::milliseconds(200), bind(&getCertificateTtl, cache, name1, true));
+  scheduler.scheduleEvent(time::milliseconds(200), bind(&getCertificateTtl, cache, name2, true));
+
+  // cert1 should removed from the cache
+  scheduler.scheduleEvent(time::milliseconds(900), bind(&checkSize, cache, 1));
+  scheduler.scheduleEvent(time::milliseconds(900), bind(&getCertificateTtl, cache, name1, false));
+  scheduler.scheduleEvent(time::milliseconds(900), bind(&getCertificateTtl, cache, name2, true));
+
+  // Refresh certificate in cache
+  scheduler.scheduleEvent(time::milliseconds(900), bind(&CertificateCache::insertCertificate,
+                                                        cache, cert2));
   scheduler.scheduleEvent(time::milliseconds(1500), bind(&getCertificateTtl, cache, name2, true));
   scheduler.scheduleEvent(time::milliseconds(2500), bind(&getCertificateTtl, cache, name2, false));
 
-  io->run();
+  // Purge
+  scheduler.scheduleEvent(time::milliseconds(3000), bind(&CertificateCache::insertCertificate,
+                                                         cache, cert1));
+  scheduler.scheduleEvent(time::milliseconds(3000), bind(&CertificateCache::insertCertificate,
+                                                         cache, cert2));
+  scheduler.scheduleEvent(time::milliseconds(3100), bind(&checkSize, cache, 2));
+  scheduler.scheduleEvent(time::milliseconds(3200), bind(&CertificateCache::reset, cache));
+  scheduler.scheduleEvent(time::milliseconds(3300), bind(&getCertificateTtl, cache, name1, false));
+  scheduler.scheduleEvent(time::milliseconds(3300), bind(&getCertificateTtl, cache, name2, false));
+  scheduler.scheduleEvent(time::milliseconds(3400), bind(&checkSize, cache, 0));
+
+  io.run();
 }
 
 BOOST_AUTO_TEST_SUITE_END()
