Skip to content

Allow internal cache to be disabled #730

@AndrewLeedham

Description

@AndrewLeedham

I am running in to memory limits when compiling lots of mustache.js templates in one go (for testing purposes). I am wanting to disable mustache's internal cache and implement my own that would remove stale templates. This is currently not possible, the only API seems to be cache clearing. Is it something that has been considered for this project? If not does it seem like it fits with the library? Happy to put in a PR.

Possible workarounds:

  • Clear the cache after every component render, this seems inefficient.
  • Monkey patch the Writer.prototype.parse function to skip the caching. This is the best current solution but having it as a first class API would be better.

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