-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add context to Response
for including file
and file_not_found
to be identified by other shelf
Middleware
.
#395
Conversation
…luding `file` and `file_not_found` to be identified by other Shelf `Middleware`.
…o be identified by other Shelf `Middleware`.
i see where you're going here. I'd want to chat with @natebosch or @devoncarew on their thoughts This change should be documented and tested, too! |
With the |
In my use case, I maintain an in-memory cache of However, my Keep in mind that the primary purpose of a cache is to enhance response time, and the negative impact of these extra calls to |
…the original fileSystemPath. Add `Response.context` documentation.
What's the next step? Regards. |
need changelog entry and tests |
Is this still something you're interested in landing - can you take a look at adding tests? |
This is important. I will try to add some tests, but I don't have time for that in the next 15 days. |
Can you give an example of how you plan to use this? Did you consider any alternative patterns, such as always storing the key Also cc @brianquinlan - can you think of any risks in keeping the |
You can take a look at real-world code that is waiting for this: Note that if The |
A |
@natebosch @brianquinlan Next step? |
This PR will continue at PR |
Updated:
With the
Response.context
populated with the processedFile
, otherMiddleware
can manipulate theResponse
in an optimized way and also ensure the correct processedFile
. Without that, anotherMiddleware
would need to guess the processedFile
, and in some cases, re-resolveFile.stat
and also fix the directory path to the "index.html" path.