# Cloudflare에서 이미지와 CSS만 캐싱하려면 (.js 파일과 관리자 영역 제외)

**URL:** https://meta.discourse.org/t/how-to-enable-cloudflare-caching-of-images-and-css-only-exclude-js-files-and-admin-area/222996
**Category:** Self-hosting
**Created:** [4월 3, 2022, 12:23오후 UTC](https://meta.discourse.org/t/how-to-enable-cloudflare-caching-of-images-and-css-only-exclude-js-files-and-admin-area/222996 "2022-04-03T12:23:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [4월 3, 2022, 12:23오후 UTC](https://meta.discourse.org/t/how-to-enable-cloudflare-caching-of-images-and-css-only-exclude-js-files-and-admin-area/222996/1 "2022-04-03T12:23:30Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/1/7/17cbcddcf1a0313c325bdf1d0584bc3b53807cbd.png)

페이지 규칙을 사용했습니다. 아직 테스트 중이지만, 한 달간 사용하면서 충돌이나 문제가 없다면 이 게시물에 더 자세한 내용을 업데이트할 예정입니다.

이 방법이 잘 작동한다면, .js 파일 중 일부만 캐시하고 특정 파일은 제외하도록 규칙을 더 광범위하게 수정할 계획입니다.

**수정:** 지금까지 문제없습니다. [포럼](https://forums.haydenjames.io/)에 방문하면 속도감을 체감할 수 있습니다. stacklinux.com으로 호스팅 중이며 (3.5GHz 코어 + NVMe @ 2G/s + 3GB 메모리) 구성되어 있습니다.

---

<div class="post-metadata">

### Author: ![Brandon007](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@Brandon007](https://meta.discourse.org/u/Brandon007)
#### Post date: [8월 18, 2022, 10:47오전 UTC](https://meta.discourse.org/t/how-to-enable-cloudflare-caching-of-images-and-css-only-exclude-js-files-and-admin-area/222996/2 "2022-08-18T10:47:25Z")

</div>

@haydenjames 다시 돌아봐서, 이게 어떻게 작동하고 있나요?

포럼을 살펴보면, Cloudflare 최적화를 사용하는 것은 큰 금기인 것 같습니다. 설치 당시 오렌지 클라우드를 꺼야 했고, 다음과 같은 설정으로 진행해야 했어요:

```plaintext
forum.domain.com/*
Cache Level: Bypass, Disable Performance

```

그 상태로 두었기 때문에 현재는 DNS만 사용하고 있습니다.

스크린샷을 보니 폴링(Polling) 부분이 눈에 띄었습니다. 최적화 설정이 Cloudflare가 "/message-bus/"를 최적화하도록 허용하는 것처럼 보이는데, 제 경험상 이로 인해 문제가 발생할 수 있습니다. 그래서 어떻게 작동하고 있는지 궁금합니다.

가능하면 모든 최적화를 받고 싶지만, 번거로움으로 인한 대가는 치르고 싶지 않아요! 😄

---

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [2월 23, 2023, 1:17오후 UTC](https://meta.discourse.org/t/how-to-enable-cloudflare-caching-of-images-and-css-only-exclude-js-files-and-admin-area/222996/3 "2023-02-23T13:17:28Z")

</div>

잘 작동하고 있습니다. 답장이 늦어서 죄송합니다. 문제가 없어서 활동하지 않았습니다.

---

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [11월 22, 2023, 2:30오후 UTC](https://meta.discourse.org/t/how-to-enable-cloudflare-caching-of-images-and-css-only-exclude-js-files-and-admin-area/222996/4 "2023-11-22T14:30:25Z")

</div>

이것도 설정에 추가해야 한다는 점을 말씀드리지 못한 것 같네요. [여기에서 추가하세요](https://meta.discourse.org/t/how-do-you-setup-cloudflare/32258/6?u=haydenjames). 그러면 관리자 패널에서 실제 IP 주소를 확인할 수 있습니다.
