Skip to content

Cache invalidation feature

Alex O. Karasulu edited this page Mar 10, 2018 · 2 revisions

This the configuration to enables cache invalidation feature in the NGINX cache module.

proxy_cache_bypass $http_secret_header;

add_header X-Cache-Status $upstream_cache_status;

First download

Cache node is "empty", download artifact pulls from main server, so it saves in cache node.

wget https://devcdn.subutai.io:8338/kurjun/rest/template/download?name=abdysamat-apache-subutai-template_4.0.0_amd64.tar.gz

Second download

It pulls from cache node.

wget https://devcdn.subutai.io:8338/kurjun/rest/template/download?name=abdysamat-apache-subutai-template_4.0.0_amd64.tar.gz

Third download

For third download we want that it pulls from main server, not in cache node. That can be done with additional header. So we invalidate cache with this request.

wget -d --header="secret-header:true" https://devcdn.subutai.io:8338/kurjun/rest/template/download?name=abdysamat-apache-subutai-template_4.0.0_amd64.tar.gz