0
頁面有兩個緩存。一個用於PC網頁瀏覽器,另一個用於移動瀏覽器。如何清除不同用戶代理的nginx緩存
nginx可以做到這一點完美。如下是nginx的CONF內容的一部分:
map $http_user_agent $device_type {
default 'pc';
~(iPhone|Android|IEMobile|Balckberry) 'mobile';
}
#fast cgi cache def
fastcgi_cache_path /data0/nginx-1.2.6/cache levels=1:2 keys_zone=nginx_webpy_cache:30m inactive=1d;
fastcgi_temp_path /data0/nginx-1.2.6/cache/temp;
fastcgi_cache_key "$request_method$scheme$host$request_uri$device_type$is_args$args";
#end
你看,我把DEVICE_TYPE $到緩存鍵拖緩存版本。
但我發現這個conf,我無法清除nginx緩存。如何清除這些拖放緩存版本?
非常感謝。