Here's the documentation:
proxy_cache_bypass
Defines conditions under which the response will not be taken from a cache. If at least one value of the string parameters is not empty and is not equal to “0” then the response will not be taken from the cache:proxy_cache_bypass $cookie_nocache $arg_nocache$arg_comment;
proxy_cache_bypass $http_pragma $http_authorization;
Can be used along with the proxy_no_cache directive.proxy_no_cache
Defines conditions under which the response will not be saved to a cache. If at least one value of the string parameters is not empty and is not equal to “0” then the response will not be saved:proxy_no_cache $cookie_nocache $arg_nocache$arg_comment;
proxy_no_cache $http_pragma $http_authorization;
Can be used along with the proxy_cache_bypass directive.
Does that mean if I want to totally exclude something in cache, I should set both proxy_no_cache
and proxy_cache_bypass
? Is it OK if I only set proxy_cache_bypass
?
Defines conditions under which the response will not be taken from a cache.
Cache both static and dynamic content from your proxied web and application servers, to speed delivery to clients and reduce the load on the servers.
By default, NGINX Plus and NGINX serve cached content for as long as it is valid. Validity is configurable or can be controlled by the Cache-Control header set by the origin server.
Go to the “Web Server” tab. In the “nginx settings” section, select the “Enable nginx caching” checkbox. (Optional) You can customize nginx caching settings. If you are not familiar with nginx caching, we recommend that you keep the default settings.
Yes.
If you just have proxy_cache_bypass set true on pages you don't want cached (eg. logged in users) then they will still be saved into the cache and served to people who should get cached pages (eg. non logged in users).
But setting both proxy_cache_bypass and proxy_no_cache to true means that those users neither receive nor contribute to the cache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With