Cache and serve 404 response#360
Merged
eduardoboucas merged 12 commits intodevelopfrom May 16, 2018
Merged
Conversation
|
|
||
| return cache.get(encryptedKey).catch(err => { // eslint-disable-line handle-callback-err | ||
| return null | ||
| return cache.get(encryptedKey).then(stream => { |
Contributor
There was a problem hiding this comment.
I'm not sure I'm a fan of changing the response format of this method to accommodate the need to return multiple values when requesting metadata. My preference would be to have a getMetadata method in the cache module, which would be called separately after an item has been successfully obtained from cache.
Instead of:
- Call
cache.getStream(k), which returns an objectx, and access the stream viax.cachedStreamand the metadata viax.metadata
I would do:
- Call
cache.getStream(k)which returns a stream ornull - If the above is truthy, I make a call for its metadata if I'm interested in it –
cache.getMetadata(k)
This would mean no breaking changes to existing calls to getStream, and also you wouldn't need to drill down into the response object if you were only interested in the stream and not any metadata associated to it.
…che-404-response # Conflicts: # dadi/lib/cache/index.js
Contributor
Author
|
This has been load tested |
Update 404 caching logic
Add acceptance tests for caching of 404
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.