Skip to content

Invalidation happens only at template compile time #1

@akaihola

Description

@akaihola

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions