Skip to content

Better caching support #196

@ankopainting

Description

@ankopainting

Thanks for an excellent project.

We have a long running nodejs application which is parsing templates that can be up to 3MB. As you can imagine, the parsing/tokenising stages can take a while. We can turn cache: true on in the options, but eventually it eats all our memory.

We also tried to do a parse call which gives us an ITemplate[], which we cache ourselves until we need to render it. This works quite well, but we are still consuming a LOT of memory. A 40KB template is using about 1.2MB in our cache.

So I guess there are two requests here;

  1. could we have a max entries in the cache? So it evicts the oldest? like an LRU cache?
  2. Is there a way we could serialise the parsed/tokenised template to json or something, ie. no complex objects

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions