Skip to content

Hybrid Cache - Optimize performance #34974

@michaelmcneilnet

Description

@michaelmcneilnet

Description

The docs state:

In such cases, inform HybridCache that it's safe to reuse instances by:

- Marking the type as sealed. The sealed keyword in C# means that the class can't be inherited.
- Applying the [ImmutableObject(true)] attribute to the type. The [ImmutableObject(true)] attribute indicates that the object's state can't be changed after it's created.

It's not clear to me if both sealed and the attribute need to be applied, or if just one of these options needs to be applied.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/performance/caching/hybrid.md

Document ID

fdd3c6f2-c3f4-6fc7-0928-0b18ba9297cf

Platform Id

77e7a2f3-9ddb-06e2-9b46-7ddeb411f8c4

Article author

@tdykstra

Metadata

  • ID: fdd3c6f2-c3f4-6fc7-0928-0b18ba9297cf
  • PlatformId: 77e7a2f3-9ddb-06e2-9b46-7ddeb411f8c4
  • Service: aspnet-core
  • Sub-service: performance

Related Issues

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions