ventojs / vento

🌬 A template engine for Deno & Node
https://vento.js.org/
MIT License
203 stars 12 forks source link

Add `cache` option #31

Closed wrapperup closed 8 months ago

wrapperup commented 8 months ago

This adds an option to disable the cache, useful if you want to iterate on templates in dev-time. The cache is still set (template internals still use them), but cache hits are ignored.

oscarotero commented 8 months ago

Okay but I have two questions:

wrapperup commented 8 months ago

Clearing the cache is a nicer approach. I guess at some level this should be done in the integration, rather than here.

Perhaps instead there should be a split in the run API, one is user facing (we can clear the cache there) and the internal one plugins/etc can use.

If not, I think documenting this trick would be great.

oscarotero commented 8 months ago

The run split would make the code more complicated, because it should pass the option to load, runString also use cache...

If clearing the cache works for you, I'd close this pull request. But feel free to open a new one if you want to contribute with the documentation!

Thanks!