Esempio n. 1
0
 def clear_cache(self):
     """
     Invalidate all possible cache keys
     """
     keys = _get_cache_keyset(settings.PAGE_RENDER_CACHE_KEY_NAME, **{
         'id': self.id,
         'setting': RSTVIEW_PARSER_FILTER_SETTINGS.keys(),
     })
     keys += _get_cache_keyset(settings.PAGE_TOC_CACHE_KEY_NAME, **{
         'id': self.id,
         'setting': RSTVIEW_PARSER_FILTER_SETTINGS.keys(),
     })
     # Drop cache for knowed pages slugs used in the ``page`` rest role
     cache.delete_many([settings.PAGE_SLUGS_CACHE_KEY_NAME]+keys)
     return keys
Esempio n. 2
0
 def clear_cache(self):
     """
     Invalidate all possible cache keys
     """
     keys = _get_cache_keyset(settings.INSERT_RENDER_CACHE_KEY_NAME, **{
         'id': self.id,
         'setting': RSTVIEW_PARSER_FILTER_SETTINGS.keys(),
         'header_level': ['None']+range(1, 7),
     })
     keys += _get_cache_keyset(settings.INSERT_TOC_CACHE_KEY_NAME, **{
         'id': self.id,
         'setting': RSTVIEW_PARSER_FILTER_SETTINGS.keys(),
         'header_level': ['None']+range(1, 7),
     })
     cache.delete_many(keys)
     return keys