-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Proxy server could cache http response when it is not private #20897
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
|
See https://www.nginx.com/blog/nginx-caching-guide/ How Does NGINX Determine Whether or Not to Cache Something? By default, NGINX respects the Cache-Control headers from origin servers. It does not cache responses with Cache-Control set to Private, No-Cache, or No-Store or with Set-Cookie in the response header. NGINX only caches GET and HEAD client requests. You can override these defaults as described in the answers below. |
|
Note that there are situations when proxy caching make sense like avatar, so I'm not 100% sure of this PR if we should just make everything only cache by browser or if we wanna have another function for private caching. |
Signed-off-by: Clement Wong <[email protected]>
|
right yes. This was on my list for ages. So avatars is not a good example. But the endpoints that server bundle js or compiled scss are public of course. Would you mind adding an optional argument 'public' (set to false by default)? |
Signed-off-by: Clement Wong <[email protected]>
|
Don't think the failed tests are related. |
https://drone.nextcloud.com/nextcloud/server/28807/10/4 That one is :) |
|
@rullzer backport? |
Missed that, and was looking at the wrong test file. |
Signed-off-by: Clement Wong <[email protected]>
Would be cool if it can be backported as I need to use it with the mail app and I'm hoping to ditch my custom code in it. |
|
I'm not 100% sure about the backport. Since it changes the API. Of course it just adds a parameter which php will happily swallow.... |
If we don't want to change the API we should backport the default to private caching IMO. |
|
Shall I default to |
|
Nah leave it to false I'd say. Like in the worst case you don't cache something in the proxy that could be cached in theory. |
|
/backport to stable19 |
|
/backport to stable18 |
|
/backport to stable17 |
|
The backport to stable18 failed. Please do this backport manually. |
|
The backport to stable17 failed. Please do this backport manually. |

Proxy server could cache http response when it is not private
Need this for nextcloud/mail#3071