DigitalOcean Spaces CDN 경로 사용
왠지 블로그 글에 포함된 이미지 로딩이 느린 것 같아서 확인해봤다.
아래 글 중에 하나에 포함된 이미지 주소는 이렇게 생겼다
Path-style 주소인데... digital ocean 주는 origin endpoint, cdn endpoint 는 각각 이렇게 생김.
Origin endpoint: https://blog-dgoon-net.sgp1.digitaloceanspaces.com/static/django-summernote/2023-11-19/6c1b4b82-1d53-47a7-a520-0695200da147.png
위의 path-style 주소가 origin 을 가리키는걸까 cdn 을 가리키는걸까? 일단 Origin, CDN 주소의 헤더를 각각 확인해보자.
---
Origin endpoint:
(base) dgoon@vora:~$ curl -I https://blog-dgoon-net.sgp1.digitaloceanspaces.com/static/django-summernote/2023-11-19/6c1b4b82-1d53-47a7-a520-0695200da147.png
HTTP/2 200
content-length: 24600
accept-ranges: bytes
last-modified: Sun, 19 Nov 2023 13:23:08 GMT
x-rgw-object-type: Normal
etag: "76b87abb6906b04f744c05e8de6da1f9"
cache-control: max-age=86400
x-amz-request-id: tx00000729a4358110f3d3b-00658a3945-33d68f47-sgp1b
content-type: image/png
date: Tue, 26 Dec 2023 02:24:05 GMT
vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
strict-transport-security: max-age=15552000; includeSubDomains; preload
x-envoy-upstream-healthchecked-cluster:
CDN endpoint:
(base) dgoon@vora:~$ curl -I https://blog-dgoon-net.sgp1.cdn.digitaloceanspaces.com/static/django-summernote/2023-11-19/6c1b4b82-1d53-47a7-a520-0695200da147.png
HTTP/2 200
date: Tue, 26 Dec 2023 02:24:18 GMT
content-type: image/png
content-length: 24600
last-modified: Sun, 19 Nov 2023 13:23:08 GMT
x-rgw-object-type: Normal
etag: "76b87abb6906b04f744c05e8de6da1f9"
cache-control: max-age=86400
x-amz-request-id: tx000007060790159d07a72-006589d30b-33d68f8d-sgp1b
vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
strict-transport-security: max-age=15552000; includeSubDomains; preload
x-do-cdn-uuid: d0dedba3-60ae-41ee-b823-0833a103c49e
x-envoy-upstream-healthchecked-cluster:
cf-cache-status: HIT
age: 26183
accept-ranges: bytes
set-cookie: __cf_bm=HZlNx4MDHhAytD1hrHt.6K4HXM4HC8WmmAsy8ZHpvg0-1703557458-1-ATlB27l381GZPOdKfJoQToicqIFuZvPR1lGPynFQmklLR4UT6GQ6uh55YRlmN1h0/6gXV2KnIcxntrKgfUHhwnI=; path=/; expires=Tue, 26-Dec-23 02:54:18 GMT; domain=.digitaloceanspaces.com; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 83b5dde3fc82ee0d-ICN
생겨먹은게 좀 다르다. 그럼 현재 블로그에 쓰이고 있는 path style 주소는 어떤 녀석일까?
(base) dgoon@vora:~$ curl -I https://sgp1.digitaloceanspaces.com/blog-dgoon-net/static/django-summernote/2023-11-19/6c1b4b82-1d53-47a7-a520-0695200da147.png
HTTP/2 200
content-length: 24600
accept-ranges: bytes
last-modified: Sun, 19 Nov 2023 13:23:08 GMT
x-rgw-object-type: Normal
etag: "76b87abb6906b04f744c05e8de6da1f9"
cache-control: max-age=86400
x-amz-request-id: tx000008742a34e32d674d4-00658a3a12-3389eef2-sgp1b
content-type: image/png
date: Tue, 26 Dec 2023 02:27:30 GMT
vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
strict-transport-security: max-age=15552000; includeSubDomains; preload
x-envoy-upstream-healthchecked-cluster: