Ejemplo n.º 1
0
 def process_request(self, request):
     """
     Stores whether or not FORCE_DJANGO_CACHE_MISS_KEY was supplied in the
     request. Also, clears the request cache.
     """
     RequestCache.clear()
     TieredCache._get_and_set_force_cache_miss(request)  # pylint: disable=protected-access
Ejemplo n.º 2
0
 def test_clear(self):
     RequestCache.set(TEST_KEY, EXPECTED_VALUE)
     RequestCache.clear()
     cached_response = RequestCache.get_cached_response(TEST_KEY)
     self.assertTrue(cached_response.is_miss)
Ejemplo n.º 3
0
 def setUp(self):
     RequestCache.clear()
Ejemplo n.º 4
0
 def process_exception(self, request, exception):  # pylint: disable=unused-argument
     """
     Clear the request cache after a failed request.
     """
     RequestCache.clear()
     return None
Ejemplo n.º 5
0
 def process_response(self, request, response):  # pylint: disable=unused-argument
     """
      Clear the request cache after processing a response.
      """
     RequestCache.clear()
     return response