Closed s-cork closed 2 months ago
I think the api is required, but because the non-caching version seemingly behaves differently, it would be worth adjusting.
naming:
cache_deps
get_cache_deps
cache_key
get_cache_key
I like cache_deps because we will always cache by the path, and then by whatever is returned form cache_deps
path
By default we could return the query
Route: def cache_deps(self, **loader_args): return loader_args["query"]
i.e. forms/data are cached by the path and the query by default
And then if you want to override this you can
MyRoute(Route): cache_form = True def cache_deps(self, **loader_args): return None
In this case MyRoute will create a new form instance whenever the query changes
MyRoute
tagging @daviesian for opinion
I think the api is required, but because the non-caching version seemingly behaves differently, it would be worth adjusting.
naming:
cache_deps
get_cache_deps
cache_key
get_cache_key
I like
cache_deps
because we will always cache by thepath
, and then by whatever is returned formcache_deps
By default we could return the query
i.e. forms/data are cached by the path and the query by default
And then if you want to override this you can
In this case
MyRoute
will create a new form instance whenever the query changestagging @daviesian for opinion