NGINX缓存
1.使用expires缓存
location ~ .*\.(jpg|gif|png)$ {
root /data/image;
expires 1h;
}
访问时出现304字段
2.作为代理服务器缓存
proxy_cache_path /data/cache levels=1:2 keys_zone=static_cache:10m max_size=10g inactive=60m use_temp_path=off;
server {
listen 80 default_server;
location /static {
proxy_set_header host $host;