I saw official NGINX tutorial regarding content caching and tried to modify it according to my needs. I use CDN (Cloudfront), but the performance doesn't convince me. If my server was more faster it'd do better in Core Web Vitals or Page Experience in issues related to server response time and more. I need a global content caching system in my server to reduce workload and improve performance, that's why I even bought additional storage in my server. Neither nginx -t command is helpful, 'cause it doesn't detect anything 'abnormal'.
My nginx.conf
...
http {
...
proxy_cache_path /var/nginx/data keys_zone=mycache:10m;
server {
proxy_cache mycache;
location / {
proxy_pass http://localhost:8000;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
}
}
...
}
...
The config above isn't working. I expected to see some data/cache in the folder reserved for caching system, but is empty. What should I do?