'Invalidate this :class:`.CacheRegion`.
Invalidation works by setting a current timestamp
(using ``time.time()``)
representing the "minimum creation time" for
a value.  Any retrieved value whose creation
time is prior to this timestamp
is considered to be stale.  It does not
affect the data in the cache in any way, and is also
local to this instance of :class:`.CacheRegion`.
Once set, the invalidation time is honored by
the :meth:`.CacheRegion.get_or_create`,
:meth:`.CacheRegion.get_or_create_multi` and
:meth:`.CacheRegion.get` methods.
The method supports both "hard" and "soft" invalidation
options.  With "hard" invalidation,
:meth:`.CacheRegion.get_or_create` will force an immediate
regeneration of the value which all getters will wait for.
With "soft" invalidation, subsequent getters will return the
"old" value until the new one is available.
Usage of "soft" invalidation requires that the region or the method
is given a non-None expiration time.
.. versionadded:: 0.3.0
:param hard: if True, cache values will all require immediate
regeneration; dogpile logic won\'t be used.  If False, the
creation time of existing values will be pushed back before
the expiration time so that a return+regen will be invoked.
.. versionadded:: 0.5.1'

def invalidate(self, hard=True):

    if hard:
        self._hard_invalidated = time.time()
        self._soft_invalidated = None
    else:
        self._hard_invalidated = None
        self._soft_invalidated = time.time()
