-
Notifications
You must be signed in to change notification settings - Fork 703
www/nginx: Add basic support for forced caching #4481
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
Conversation
Hi! |
Perhaps - but in this case it might be letting "perfect" get in the way of "good"; the more advanced approach would take a lot more work, and testing. At least until that is done, this is likely to solve a lot of the situations where it might be a problem. |
<cache_valid type="IntegerField"> | ||
<Required>N</Required> | ||
</cache_valid> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<cache_valid type="IntegerField"> | |
<Required>N</Required> | |
</cache_valid> | |
<cache_valid type="IntegerField"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for me as advanced opt-in
@fichtner @ltning if you give me a couple of weeks i will try to find time and add this to https://github.com/kulikov-a/plugins/tree/nginx_1.35 and make a pr |
@kulikov-a 25.1 is due next week and I don't mind having both a simple short term and a better long term solution |
got it, thanks!) |
@kulikov-a thanks, looking forward to your proposal :) @ltning merged, thanks! |
proxy_intercept_errors support (opnsense#4224) multiple client auth CA support (opnsense#4421) HTTP/2 server checkbox (opnsense#4272) sendfile form typo (opnsense#4436) variables hashes (opnsense#4360) proxy_cache_valid (opnsense#4481)
Fixes #4475 by adding an optional, advanced field for locations, which uses the simples variant of the proxy_cache_valid statement. By default, this will set the given cache validity for results with HTTP 200, 301 or 302 response codes.
Making sure caching only happens for objects that should be cached remains an exercise for the user. This helps the cases where upstreams don't set cache headers at all, in which case nginx will not cache.