Skip to content
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

[Discussion] Making "pubinternal" types in ResponseCaching internal #9442

Open
JunTaoLuo opened this issue Apr 16, 2019 · 1 comment

Comments

@JunTaoLuo
Copy link
Contributor

commented Apr 16, 2019

In ASP.NET Core, pubinternal types are types that are declared as public but put in an .Internal namespace. While these types are public they have no support policy and are subject to breaking changes. Unfortunately accidental use of these types has been common, resulting in breaking changes to these projects and limiting our ability to maintain the framework.

In ASP.NET Core 3.0, we are moving pubinternal types in ResponseCaching to internal. This includes the following types:

Microsoft.AspNetCore.ResponseCaching.Internal.CachedResponse
Microsoft.AspNetCore.ResponseCaching.Internal.CachedVaryByRules
Microsoft.AspNetCore.ResponseCaching.Internal.IResponseCache
Microsoft.AspNetCore.ResponseCaching.Internal.IResponseCacheEntry
Microsoft.AspNetCore.ResponseCaching.Internal.IResponseCachingKeyProvider
Microsoft.AspNetCore.ResponseCaching.Internal.IResponseCachingPolicyProvider
Microsoft.AspNetCore.ResponseCaching.Internal.MemoryResponseCache
Microsoft.AspNetCore.ResponseCaching.Internal.ResponseCachingContext
Microsoft.AspNetCore.ResponseCaching.Internal.ResponseCachingKeyProvider
Microsoft.AspNetCore.ResponseCaching.Internal.ResponseCachingPolicyProvider

In addition, a default implementation for IResponseCachingPolicyProvider and IResponseCachingKeyProvider will no longer be added to services as part of AddResponseCaching method. Also, the constructor for ResponseCachingMiddleware has been changed from:

public ResponseCachingMiddleware(RequestDelegate next, IOptions<ResponseCachingOptions> options, ILoggerFactory loggerFactory, IResponseCachingPolicyProvider policyProvider, IResponseCachingKeyProvider keyProvider)

to:

public ResponseCachingMiddleware(RequestDelegate next, IOptions<ResponseCachingOptions> options, ILoggerFactory loggerFactory, ObjectPoolProvider poolProvider)

If if any changes to these types are critical to your applications, please file an issue in https://github.com/aspnet/Aspnetcore.

@jeroenheijmans

This comment has been minimized.

Copy link

commented Apr 17, 2019

Purely of curiosity, what is the typical use case (or if that's unanswerable: what was the use case here) for making such "pubinternal" types in the first place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.