hey,
I’m using this for myself, but only for static files:
location ~* \.(css|js)$ {
expires 7d;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
add_header "Vary" "Accept-Encoding";
}
location ~* \.(png|ico|gif|svg|jpg|jpeg|webp)$ {
expires 14d;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
add_header "Vary" "Accept-Encoding";
}
location ~* \.(avi|mpg|mpeg|mp4|mp3)$ {
expires 14d;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
add_header "Vary" "Accept-Encoding";
}
I do not add these headers to the regular pages but I guess you could if you want to.