balderdashy / balderdashy/sails
Handlebars: the ejs layout is not been cached.
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Sails version**:latest
**Node version**:v8.9.4
**NPM version**:v5.6.0
**DB adapter name**: N/A
**DB adapter version**: N/A
**Operating system**:N/A
the layout feature in default-view-rendering-fn.js is not correctly set cache, the ejs doc says:
1.cache Compiled functions are cached, requires filename
2.filename The name of the file being rendered. Not required if you are using renderFile(). Used by cache to key caches, and for includes.

which is incorrect, should not delete the options.filename, and set options.cache = true
I've test this and it works, the layout should be cached as it's content is not change much, makes it renders faster!
Contributor guide
Research direction
Read default-view-rendering-fn.js and the EJS caching notes in the issue first. Reproduce the layout rendering case, then verify that the layout retains options.filename and enables options.cache without changing rendering behavior; done means the layout is cached and renders correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100