I have a requirement where I need to support downgrading of my server code.
I have the following line in my nginx configuration file, indicating that the browser can cache the page but has to validate with server to check if the file changed.
add_header Cache-Control "no-cache";
This setup works perfectly fine for me with all the upgrades done on my server code.
But when it comes to downgrading a resource to an older version, when the browser tries to validate the resource change, nginx says that the resource hasn't changed, so the browser shows the cached(newer) resource instead of the downgraded(older) resource.
As a workaround, I could use the following setting to disable cache completely, but its not efficient, and I would like to have caching.
add_header Cache-Control "no-store";
So how would I make nginx recognize downgrades??