Skip to content

Better control of caching logic by following headers and a manual option to turn of caching for a request #19

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

Merged
merged 5 commits into from
Feb 24, 2025

Conversation

ThaDaVos
Copy link
Contributor

@ThaDaVos ThaDaVos commented Jul 11, 2024

This PR adds support for better control of what is cached and when - first of, using HttpRequestMessage.Properties/Options with a specific key allows one to disable checking the cache for a request. It also follows the Cache-Control headers from the server, including the max-age if it's lower than the specified cache time.

Issue: #18

ThaDaVos added 3 commits July 4, 2024 11:38
…st and changed logic for Cache Expiration to include the `max-age` value if it's less than what we configured for the status code
@thomasgalliker
Copy link
Owner

I‘ll have a look at it. Thanks for your effort.

@thomasgalliker thomasgalliker self-assigned this Oct 4, 2024
@ThaDaVos
Copy link
Contributor Author

Any ETA? Or Update?

@thomasgalliker
Copy link
Owner

Ok I did have a look at this. Just two small comments, if you want to have a look at the review.

@thomasgalliker
Copy link
Owner

How did you test this?

@ThaDaVos
Copy link
Contributor Author

Back then I used Wireguard to check for traffic and called REST API I was working on implementing - and saw it cached the response based on the given max-age - testing the manual turn off was easy, just saw it fire the request each time instead only when the cache expired.

How so? Is there a problem?

@thomasgalliker
Copy link
Owner

thomasgalliker commented Feb 15, 2025

How so? Is there a problem?

Not a problem. The thing is just, I generally understand what the code does, but is it bullet proof? We can only find out if we test it with unit tests. To be honest, I don't know if the rest of the code is well tested. I'd do some unit tests to prove that we didn't forget anything. I'm just sharing my thougts, I don't want to offend you :)

@thomasgalliker thomasgalliker merged commit f1583b0 into thomasgalliker:develop Feb 24, 2025
@thomasgalliker
Copy link
Owner

You can find the changes in the latest 1.6.x pre release. Let me know if it works as expected. Then I release it as stable nuget. Thank you @ThaDaVos

@ThaDaVos
Copy link
Contributor Author

Curious, but when get we expect a stable 1.6.x release? I saw the nuget still shows 1.3.7 as latest stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants