nginxinc / nginx-s3-gateway

NGINX S3 Caching Gateway
Apache License 2.0
496 stars 126 forks source link

How to completely disable cache? #223

Closed AbstractiveNord closed 6 months ago

AbstractiveNord commented 6 months ago

I have a legacy system, which I have to connect to S3. Caching works on that system. Have to disable cache on nginx s3 gateway?

4141done commented 6 months ago

So we don't have a formal way to disable caching, but you can set PROXY_CACHE_MAX_SIZE = "0" which will functionally stop requests from being served from the cache.

I just tested it locally and I did see that no cache files were created. However, some NGINX variables like $upstream_cache_status will still show HIT for keys that are repeatedly requested.

The correct way to do this is to set proxy_cache off; In this file

For more information on how to use these files, see this reference https://github.com/nginxinc/nginx-s3-gateway/blob/master/docs/development.md#stub-files

AbstractiveNord commented 6 months ago

Thanks!