-
Notifications
You must be signed in to change notification settings - Fork 763
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
HybridCache : implement the tag expiration feature #5748
base: dev
Are you sure you want to change the base?
Conversation
I am not sure Console.WriteLine(TimeProvider.System.GetTimestamp());
Console.WriteLine(TimeProvider.System.GetUtcNow());
Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.OSDescription);
|
@sebastienros thanks, great catch! I incorrectly assumed that this was a defined value like epoch ticks or something. Apparently not. I'll rework that into something reliable. |
There is TimestampFrequency, but I will change to use GetUtcNow() instead. |
Use ticks (but same normalization issue) or a sortable numeric format (yyyymmddhhmmssxxxx), or use an EPOCH so 0 starts at 1/1/2025 ;) then numbers are much smaller. |
I considered that - if you think it won't be contentious, sure I can use an atypical epoch. At stackoverflow, we used "stack seconds" in a few key places :) however, the fixed size is highly desirable, and I'd rather not get into 32-bit pain. Honestly, I think it is better to just pay for 64 and not worry about it. |
FWIW |
Implement tag expiration in
HybridCache
The
HybridCache
system has a "tags" feature; rather than building a bespoke per-backend secondary index (like how the redis OutputCache backend works), here we move everything into the core library:DefaultHybridCache
, we maintain a map of tags (string
, note*
means everything) to expirations, and we track the creation time against eachCacheItem
Because the tag fetches are async, the data in the lookup is not
(timestamp)
, it isTask<(timestamp)>
Outstanding:
Microsoft Reviewers: Open in CodeFlow