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

Add configurable options for ResponseCaching #16

Merged
merged 1 commit into from
Aug 26, 2016

Conversation

JunTaoLuo
Copy link
Contributor

Override RequestIsCacheable
Override ResponseIsCacheable
Append customized cache key

Will add more configurability options as features are added.

/// <summary>
/// Create a custom segment that is appended to the default cache key.
/// </summary>
public Func<HttpContext, string> CreateCustomizedCacheKey { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can consider passing the StringBuilder that contains the default key to the user. It may be more efficient if the user needs to concatenate many small segments since it saves creating a new instance of StringBuilder. But not sure how often this would arise and it may be a premature optimization. It would also have the side effect of the user being able to overwrite the default cache key.

Copy link
Member

Choose a reason for hiding this comment

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

They can get a string builder from the request services caching service

Copy link
Member

Choose a reason for hiding this comment

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

Also, interfaces prevent adding events. See aspnet/Security#942

@JunTaoLuo
Copy link
Contributor Author

🆙📅

@JunTaoLuo JunTaoLuo force-pushed the johluo/configureable-options branch 3 times, most recently from 763b45f to 58be8ea Compare August 25, 2016 22:32
Override RequestIsCacheable

Override ResponseIsCacheable

Append customized cache key
@JunTaoLuo JunTaoLuo force-pushed the johluo/configureable-options branch from 58be8ea to fb724a7 Compare August 25, 2016 23:26
@JunTaoLuo
Copy link
Contributor Author

ping

@Tratcher
Copy link
Member

:shipit:

@JunTaoLuo JunTaoLuo merged commit fb724a7 into dev Aug 26, 2016
@JunTaoLuo JunTaoLuo deleted the johluo/configureable-options branch August 26, 2016 17:08
@JunTaoLuo JunTaoLuo mentioned this pull request Aug 29, 2016
34 tasks
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.

5 participants