css, js 파일 수정 시 버저닝을 통해 브라우저 캐시 초기화할 필요없이 프론트 개발 및 테스트
application.yml 설정 추가
spring:
web:
resources:
chain:
strategy:
content:
enabled: true
paths: /css/**, /js/**
html 에서 사용법
<link rel="stylesheet" th:href="@{/css/main.min.css}">
<script th:src="@{/js/main.min.js}"></script>
개발자 도구로 결과 확인
https://stackoverflow.com/questions/48732894/spring-mvc-and-thymeleaf-resource-versioning
Spring MVC and Thymeleaf Resource Versioning
I am trying resource versioning with Spring Mvc 4.I use thymeleaf template engine.But doesnt work with the following code.When load the page I cant see new version Url when i view the page source.S...
stackoverflow.com
'Backend > SpringBoot' 카테고리의 다른 글
No enum constant com.google.firebase.ErrorCode.UNIMPLEMENTED (1) | 2024.09.06 |
---|---|
Communications link failure (0) | 2024.09.06 |
@GetMapping에서 URL 경로 변수로 특수 문자를 처리 (0) | 2024.09.06 |