Configuring nginx web caching time
Edit the main configuration file
vim /usr/local/nginx/conf/nginx.conf
next add a server LOCATION
LOCATION ~ * \ (GIF | JPG | PNG | BMP | ICO) {$.
Expires 1D; # set the cache time
}
LOCATION ~ . * \ (CSS | JS) $ {
the Expires 1H; # set the cache time
}
vim /usr/local/nginx/conf/nginx.conf
next add a server LOCATION
LOCATION ~ * \ (GIF | JPG | PNG | BMP | ICO) {$.
Expires 1D; # set the cache time
}
LOCATION ~ . * \ (CSS | JS) $ {
the Expires 1H; # set the cache time
}