Set-PSUCache -AbsoluteExpirationFromNow does not expire

Set-PSUCache -AbsoluteExpirationFromNow does not expire

avatar
(anonymous user)

I understand that the following cache variable should expire after 6 minutes.

Set-PSUCache -Key “SavedText1” -Value “Saved text 1” -AbsoluteExpirationFromNow ([TimeSpan]::FromMinutes(6))

However, it is still available 40 minutes later. I can retrieve the value from cache and can also see it on the portal.

KeyPersistentCreatedUpdatedLast ReadExpirationSliding ExpirationAbsolute Expiration Relative To NowSavedText1NoMay 13, 2025 10:05 AMMay 13, 2025 10:14 AMMay 13, 2025 10:41 AM00:06:00Product: PowerShell Universal
Version: 5.5.2


All Comments (3)

avatar

It’s still there, 2 days later…

avatar

Hey @AnonymousUser , Ive tried it here as well and can see the same behaviour in 5.4.1

I can see a number of issues with the expiration behaviour. Once I read a cached item it doesnt expire regardless of if its using absolute or sliding windows. seems like a bug

Ill log one i github for it now

avatar