
我嘗試在 nginx 設定檔中為所有 css/js 檔案添加緩存,但出現錯誤。
location ~* \.(css|js)$ {
add_header Cache-Control public;
add_header Pragma public;
add_header Vary Accept-Encoding;
expires 1M;
}
問題是 - 如果我添加“return 200 'Hello Test 5';”在位置區塊的末尾,我看到我的標頭並過期 1M。但我需要實施它而不返回