ember-fastboot / ember-fastboot/fastboot-app-server

Cache middleware fails to intercept response if chunkedResponse is enabled

Open
#85 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
140
Forks
70
PR merge metrics
No merged PRs in 30d

Description

When a cache (like [https://github.com/tomdale/fastboot-redis-cache](fastboot-redis-cache)) is provided, the Express server [builds middleware](https://github.com/ember-fastboot/fastboot-app-server/blob/master/src/express-http-server.js#L70-L87) to read/write cache entries.

To grab responses, it replaces the implementation of `res.send` with one that stores to the cache [here](https://github.com/ember-fastboot/fastboot-app-server/blob/master/src/express-http-server.js#L89-L108).

When chunked responses are enabled `res.write` is called instead of `res.send`, so nothing is ever written to the cache.

Using something like https://github.com/axiomzen/express-interceptor (or implementing similar techniques) would solve this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.