Static Resource 처리

CHM·2022년 6월 16일
0

Spring

목록 보기
14/26

Static Web Resource 처리

  • 서버의 처리가 필요없는 static web resources는 요청 시 서버를 거치지 않고 곧바로 응답이 필요
  • 특정 URL로 요청이 오면 static resource로 인식하고 바로 응답 수행
  • 대표적 static web resources : Javascript, css, 이미지파일 등
  • 용량이 클 수 있기 때문에 얼마나 빨리 response 하느냐가 성능에 영향을 줄 수 있음
  • static resource 태그
    • mapping : HTTP 요청 URL
    • location : 실제 응답할 파일이 있는 위치
    <mvc:resources mapping="/resources/**" location="WEB-INF/resources/"/>
  • 태그 예시
    • 요청
    http://localhost:8080/hello/resources/scripts/jQuery.js
    • 응답
    /WEB-INF/resources/scripts/jQuery.js

0개의 댓글