-
Notifications
You must be signed in to change notification settings - Fork 134
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
No caching when using Docker image. #64
Comments
Thank you for writing up this issue in such detail. So far, I've been unable to reproduce this bug using AWS. In my configuration, I've put a text file on my S3 bucket and ran curl against it in a loop. I saw that the cache files were correctly populated in the On my container, the contents of the cache directory look like:
I'll go and try to see if I can reproduce the issue on Google Cloud Storage. |
I just ran the same configuration against Google Cloud Storage and I was able to reproduce the behavior. |
I found the source of the issue. Google Cloud Storage diverges from the AWS S3 behavior by setting There may be a way to configure NGINX to ignore the header sent by Google Cloud Storage by using the |
Many thanks for tracking down the root cause of this issue. As you (@dekobon ) suggested, I added I now have some choices.
I would like to first ask for no.3 . What are your thoughts? Again, thanks! |
I think asking for number three is reasonable. We may need a generalized way to accomplish this because we also need to solve for #65 . |
I've made some updates to the container so that you can now layer in additional NGINX configuration. See the documentation. Also, I added a feature that allows you to strip out headers from the client response. For Google Cloud Storage you will want to do:
Please let me know if this solution works for you. If it does, I'll mark this issue as closed. |
I would have preferred an environment variable solution, but this config works as well. Before closing this issue I believe the need for |
I agree it should be documented. Also, we may want to add an environment variable that allows for ignoring cache control, but I wanted to get the extensibility part done ASAP because we've gotten a lot of requests for similar things and the number of environment variables is starting to add up. I'll leave this issue open until we can add a setting. |
I made a stupid mistake of exec into the wrong running container with the same name so i didnt find any cache |
I've just experienced this issue, and in addition to ignoring the
|
@dekobon @4141done You two seem to be the current maintainers. I really appreciate your effort to keep the project alive! From reading various discussions on the subject of caching in this GitHub project, there seems to be a general request to have more control of the ingress and egress cache configuration. |
Describe the bug
Using the latest Docker image, no data is being cached.
To Reproduce
Steps to reproduce the behavior:
docker run --rm -ti -p 80:80 -e S3_SERVER=storage.googleapis.com -e S3_ACCESS_KEY_ID="<key>" -e S3_SECRET_KEY="<secret>" --env-file s3.env nginxinc/nginx-s3-gateway:latest-20221026
s3.env
file:I can successfully browse the S3 bucket directory structure and download objects without any issue.
Although, when downloading the same object multiple times I cannot see any performance increase from a cache hit.
docker exec -ti <container> bash
Run the following command:
ls -la /var/cache/nginx/s3_proxy/
The cache directory is empty.
I also looked for looked for any disk usage increase with the command
du -sh /*
but no cached data is being stored in the container.Expected behavior
According to the documentation, data should be cached when accessed multiple times and not reloaded from the remote S3 bucket at each access.
Your environment
Docker image: nginxinc/nginx-s3-gateway:latest-20221026
Google Cloud Storage
Docker on MacOS using Rancher Desktop.
S3 authentication using Google Service Account with HMAC keys.
The text was updated successfully, but these errors were encountered: