The invalidate_template_cache() function is called inside the reset_cache() function, which in turn is registered as a template tag.
If I've understood correctly, Django executes the reset_cache() function only at template compile time. Because of this, invalidate_template_cache() is also called at compile time but never at render time.
Anything that needs to be done at render time should be in the .render() method of a template.Node subclass, and an instance of that class should be returned by the reset_cache() function.
I can't see how the tag could work as intended the way it's now implemented.
The
invalidate_template_cache()function is called inside thereset_cache()function, which in turn is registered as a template tag.If I've understood correctly, Django executes the
reset_cache()function only at template compile time. Because of this,invalidate_template_cache()is also called at compile time but never at render time.Anything that needs to be done at render time should be in the
.render()method of atemplate.Nodesubclass, and an instance of that class should be returned by thereset_cache()function.I can't see how the tag could work as intended the way it's now implemented.