Provide ability to add CacheOutputUntil
In my current project there's need to add specific times per day, when 3th party resources getting updated and we need to invalidate cache. e.g.
[CacheOutputUntil(ServerTime = "00:00:00 , 08:00:00, 15:35 , 22:00")]
I started work on it, will make pull request soon. But this is work in process, need few days to test everything and tuneup.
@Iamcerba What you think about this functionality? would you like I contribute it here or I should continue it on my forked repo? Because in our project we need this functionality! And also I'll try to complete it on weekends.
Have you tried https://github.com/Iamcerba/AspNetCore.CacheOutput/blob/master/AspNetCore.CacheOutput/TimeAttributes/CacheOutputUntilCacheAttribute.cs ?
Yeah I saw it before, it uses one time per day, but in our project external source updates twice a day, so having multiple times with integers not really useful, thats why I've used comma separated string.
It is better to implement in your fork because as for me it looks not really useful for most of people currently. I don't have enough time to unit test even existing code (
For your case, it might be useful to invalidate cache manually from another controller via a direct call to https://github.com/Iamcerba/AspNetCore.CacheOutput/blob/master/AspNetCore.CacheOutput/IApiCacheOutput.cs#L8
Or if invalidation logic is not in the API you may also create a background worker that invalidates cache based on schedule, like Hangfire for example.
Yeah, I was thinking about hangfire..