Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache theme html file #3

Closed
alessioalex opened this issue May 26, 2016 · 3 comments
Closed

cache theme html file #3

alessioalex opened this issue May 26, 2016 · 3 comments

Comments

@alessioalex
Copy link

alessioalex commented May 26, 2016

Currently if you generate 5000 emails it will synchronously load the theme file 5000 times: https://github.com/eladnava/mailgen/blob/master/index.js#L51

It would be better to keep the theme html file content into memory so that the generate function won't try to read it each time from disk. That would be a massive improvement.

@eladnava
Copy link
Owner

eladnava commented May 26, 2016

Hey @alessioalex!

Nice to meet you and thank you for reporting this!

You are absolutely right about this -- I have fixed this behavior by loading the template file once in the package constructor. :)

eladnava added a commit that referenced this issue May 26, 2016
@alessioalex
Copy link
Author

Hey! No problem. I've opened another 2 issues, let me know if you have time to take a look over them or if you need some help. Cool module btw, thanks!

@eladnava
Copy link
Owner

Excellent, glad you like it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants