jaredhanson / jaredhanson/marked-engine
Bug: Breaks with express view cache
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
The express view cache will auto enable with NODE_ENV=production
You'll get a blank template with 0 bytes every time after the first render. Current workaround is to disable the view cache `app.disable('view cache');`
`app.enable('view cache');` is a great way to reproduce this without triggering production code.
I didn't realize you needed to handle the parsing manually. Well the token cache is not saving on line 38
```
$ node --inspect ./bin/www
Debugger listening on ws://127.0.0.1:9229/35c042d9-8f26-4e9a-82c9-dc029e87ab2c
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
GET / 200 11458.736 ms - 362
GET / 200 8080.520 ms - 0
```
Contributor guide
Research direction
Reproduce the failure with app.enable('view cache') and the example command from bin/www. Inspect the token cache around line 38 and compare the first and second renders; done means the cached second render returns the complete template instead of 0 bytes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100