Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Restructure middleware flow #88

Merged
merged 1 commit into from
Jan 10, 2017
Merged

Restructure middleware flow #88

merged 1 commit into from
Jan 10, 2017

Conversation

JunTaoLuo
Copy link
Contributor

@JunTaoLuo JunTaoLuo commented Dec 14, 2016

This addresses #83 and #81

TODO:

  • Add more test scenarios (a few edge cases are going to fail right now)
  • Clean up
  • Documentation
  • Naming

@JunTaoLuo JunTaoLuo changed the title Restructure middleware flow (Very WIP) Restructure middleware flow Dec 15, 2016
@JunTaoLuo
Copy link
Contributor Author

Please take a look while @Tratcher is out.

@BrennanConroy @moozzyk

HeaderUtilities.TryParseSeconds(requestCacheControlHeaders, CacheControlHeaderValue.MaxStaleString, out requestMaxStale);

// Request allows stale values
// Request allows stale values no age limit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with no age limit

@JunTaoLuo
Copy link
Contributor Author

cc @muratg

@JunTaoLuo
Copy link
Contributor Author

ping @Tratcher

@@ -74,14 +74,16 @@ public class ResponseCachingMiddleware
var context = new ResponseCachingContext(httpContext, _logger);

// Should we attempt any caching logic?
if (_policyProvider.IsRequestCacheable(context))
if (_policyProvider.AllowResponseCaching(context))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to find a name that disambiguate AllowResponseCaching from AllowCacheStorage.
The method implementation checks if caching logic is even applicable to this kind of request.

{
return;
}

context.AllowResponseCapture = _policyProvider.AllowCacheStorage(context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restructure flow to skip more logic for false.

@JunTaoLuo JunTaoLuo force-pushed the johluo/restructure branch 2 times, most recently from a009613 to 6db4df4 Compare January 10, 2017 22:44
- Always add IresponseCachingFeatu8re before calling the next middleware #81
- Use If-Modified-Since instead of the incorrect If-Unmodified-Since header #83
- Handle proxy-revalidate in the same way as must-revalidate #83
- Handle max-stale with no specified limit #83
- Bypass cache lookup for no-cache but store the response #83
- Bypass response capturing and buffering when no-store is specified #83
- Replace IsRequestCacheable cache policy with three new independent policy checks to reflect these changes
- Modify middleware flow to accommodate cache policy updates
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants