title: How to serve static assets with an efficient cache policy on Nginx?
body: <h1>On mobile </h1>
  <p>I'm trying to improve the page load of my site</p>
  <p><a href="https://i.stack.imgur.com/vxe50.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vxe50.png" alt="enter image description here" /></a></p>
  <p>I added</p>
  <pre><code># Media: images, icons, video, audio, HTC
  location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff)$ {
      expires 1M;
      access_log off;
      add_header Cache-Control &quot;public&quot;;
  }
  
  # CSS and Javascript
  location ~* \.(?:css|js)$ {
      expires 1y;
      access_log off;
      add_header Cache-Control &quot;public&quot;;
  }
  </code></pre>
  <p>For some reasons, I feel like the changes that I just added to my Nginx is not taking any effect.</p>
  <p><a href="https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.bunlongheng.com%2F" rel="nofollow noreferrer">https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.bunlongheng.com%2F</a></p>
  <h1>How should I debug this further ?</h1>