Hangfire.PostgreSql
Hangfire.PostgreSql copied to clipboard
Cache all SQL queries using sliding expiration
Closes #278.
I don't really get this. Is building a simple string really slower than retrieving it from cache?
Why are you using expiration? Do you think the options could change over time?
The broader discussion is in #278, let's keep it there. "Slower" maybe not, but keeping allocations at minimum is always a good idea.
Regarding the expiration - there's no point in keeping the queries in memory indefinitely when there is no need for them for an extended period of time, for example any of the dashboard queries are irrelevant if you just check it occasionally, therefore can just expire.
I would choose a sliding expiration of 2 hours, instead of 30 minutes. That feels more feasible to me.
Did you compare benchmarks of previous versions and this one to compare allocations?
I did as mentioned in the comment. It might be that the pull request isn't even worth it, hence it's still idling here. First want to try a few things from the linked issue, but free time is too limited right now.
Closing as it's not something that's really beneficial.