Utils
Utils.
- controller.sentry.utils.invalidate_cache(path='')[source]
This function uses Django’s caching function get_cache_key().
Since 1.7, Django has used more variables from the request object (scheme, host, path, and query string) in order to create the MD5 hashed part of the cache_key. Additionally, Django will use your server’s timezone and language as properties as well. If internationalization is important to your application, you will most likely need to adapt this function to handle that appropriately.
Bootstrap request: request.path should point to the view endpoint you want to invalidate request.META must include the correct SERVER_NAME and SERVER_PORT as django uses these in order to build a MD5 hashed value for the cache_key. Similarly, we need to artificially set the language code on the request to ‘en-us’ to match the initial creation of the cache_key. YMMV regarding the language code.