I understand you can use proxy_no_cache to update the cache, my setup is like this:
proxy_cache_valid 200 302 20m;
proxy_cache_valid 404 1m;
proxy_no_cache $http_my_secret_header;
And I send the header like this : curl -H "My-Secret-Header: 1" "www.example.com"
Which seems to pull the updated information, however if I understand it properly it should update the cache with latest response. But it's not doing that, all the new hits are pulling information from cache till actually cache expires. Any idea on how to do this properly ?