home / django_tickets / tickets

tickets: 5815

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
5815 2007-10-25 05:20:57 2020-09-01 10:16:15 2022-03-06 03:35:27.706265 Accepted new Core (Cache system) New feature Normal dev   Adds per-view cache refreshing (clearing) This patch adds the possibility to clear(refresh) cached data per view. SmileyChris sugested it would be good to add another key to the cached keys where we could keep track of all the different cache_page_key hashes, so we that can delete those then. It is possible to clear the cache for an specific view, to achieve that, you should tell your view's url path (and optionally, a key_prefix) to ``clear_cache_for_path(path, key_prefix=None)``. {{{ from django.utils.cache import clear_cache_for_path # clear the all cached data for path '/blog/posts/2/' clear_cache_for_path('/blog/posts/2/') }}} Note that it will delete every page cached from matching this path, ``Vary`` headers doesn't matter. NOTE: Thanks SmileyChris for your help and supervision with this. nobody k0001 cache refresh clear 0 1 1 1 0 0
Powered by Datasette · Queries took 1.341ms