Configure nginx to Cache Static Files for 6 Hours and Set Browser Cache Headers
- Published
- Views
- 93
- Comments
- 0
- Words
- 0
This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|png|webp)$
{
expires 6h;
add_header Cache-Control "public, max-age=21600";
}
location ~ .*\.(js|css)?$
{
expires 6h;
add_header Cache-Control "public, max-age=21600";
}
Last updated 2024-01-14
Comments 0