HTTP 요청 수를 줄이는 캐시 방식

Cache-Control 헤더를 사용하여 다음 방문시 HTTP 요청 자체를 하지 않도록 하는 방식이다.

Cache-Control 설정값

https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/Cache-Control

아파치 설정

ExpiresDefault "access plus 1 month"
ExpiresByType image/gif "access plus 1 week"
  
<FileMatch ".(ico|jpg|jpeg|png|gif)$">
    Header set Cache-Control "max-age=86400, public, must-revalidate"
</FileMatch>