We use Bunny CDN for some months already. Here are the stats:
Cache HIT rate: 46.94 %
Total Bandwidth: 0.44 TB
Cached Bandwidth: 0.32 TB
Uncached Bandwidth: 0.12 TB
This is bad. About a quarter of the bandwith still hits the very expensive origin (Google Storage). We need to reduce theses costs.
How can we improve the Cache HIT rate to be above 95%?
Please note that we have enabled the Bunny [Perma-Cache system](https://bunny.net/cdn/perma-cache/) a few months ago, which is advertised with “Keep your cache HIT rate near to 100%”.
Here are screenshots of I think all important stats and configuration settings: [https://imgur.com/a/suM4e22](https://imgur.com/a/suM4e22)
—
I have used the browser inspector Network tab to search for the issue. But I cannot find a pattern that distinguishes HIT and MISS. But I don’t really know what I need to look for either. Here are some examples.
Example 1 (HIT):
Request URL: https://mydomain.b-cdn.net/myurl_img_rsz__1100x1100?alt=media&token=9674dc8b-e350-4fd8-abce-914b055c19c7
Request Method: GET
Status Code: 200
Referrer Policy: strict-origin-when-cross-origin
accept-ranges: bytes
alt-svc: h3=”:443″; ma=2592000
alt-svc: h3-29=”:443″; ma=2592000
cache-control: public, max-age=31919000
cdn-cache: HIT
cdn-cachedat: 01/31/2023 10:32:26
cdn-edgestorageid: 722
cdn-proxyver: 1.03
cdn-pullzone: 1026160
cdn-requestcountrycode: DE
cdn-requestid: a289e9522518373ca15d7a5f00957a6d
cdn-requestpullcode: 206
cdn-requestpullsuccess: True
cdn-status: 200
cdn-storagebalancer: DE-199
cdn-uid: 67d0c44a-c5bc-467b-a61a-63c913093a43
content-disposition: inline; filename*=utf-8”img_rsz__1100x1100
content-length: 13456
content-type: image/jpeg
date: Tue, 31 Jan 2023 15:02:03 GMT
last-modified: Thu, 12 Jan 2023 11:58:37 GMT
perma-cache: MISS
server: BunnyCDN-DE1-1076
x-goog-generation: 1673524717611814
x-goog-hash: crc32c=qbJoCw==
x-goog-hash: md5=roApWumXq3Sa4hE7RmENGQ==
x-goog-meta-firebasestoragedownloadtokens: 9674dc8b-e350-4fd8-abce-914b055c19c7
x-goog-meta-resizedimage: true
x-goog-metageneration: 1
x-goog-storage-class: STANDARD
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 13456
x-guploader-uploadid: ADPycdtHS8k8Q5amQJ3YXCDxVKABOJjFOjn7JTbfQK-K2Ix7x8Q0a4CAgaiXHcZrpYB9iBDFTcuVOv9Veitf4-VkZ4AjZAh3qe45
:authority: mydomain.b-cdn.net
:method: GET
:path: /myurlimg_rsz__1100x1100?alt=media&token=9674dc8b-e350-4fd8-abce-914b055c19c7
:scheme: https
accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,so;q=0.6
sec-ch-ua: “Not_A Brand”;v=”99″, “Google Chrome”;v=”109″, “Chromium”;v=”109″
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: “Windows”
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Example 2 (MISS):
Request URL: https://mydomain.b-cdn.net/secondurl_img_rsz__50x50?alt=media&token=ba1b0a71-cfed-4c52-bf92-d6be6f1333ae
Request Method: GET
Status Code: 200
Referrer Policy: strict-origin-when-cross-origin
accept-ranges: bytes
cache-control: public, max-age=31919000
cdn-cache: MISS
cdn-cachedat: 01/31/2023 15:02:03
cdn-edgestorageid: 874
cdn-fileserver: 548
cdn-proxyver: 1.03
cdn-pullzone: 1026160
cdn-requestcountrycode: DE
cdn-requestid: 7caf9db849b73616e5a0288ffe208bab
cdn-requestpullcode: 206
cdn-requestpullsuccess: True
cdn-status: 200
cdn-storageserver: DE-168
cdn-uid: 67d0c44a-c5bc-467b-a61a-63c913093a43
content-length: 903
content-type: image/jpeg
date: Tue, 31 Jan 2023 15:02:03 GMT
last-modified: Mon, 30 Jan 2023 14:04:47 GMT
perma-cache: HIT
server: BunnyCDN-DE1-1076
:authority: mydomain.b-cdn.net
:method: GET
:path: /secondurl_img_rsz__50x50?alt=media&token=ba1b0a71-cfed-4c52-bf92-d6be6f1333ae
:scheme: https
accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,so;q=0.6
sec-ch-ua: “Not_A Brand”;v=”99″, “Google Chrome”;v=”109″, “Chromium”;v=”109″
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: “Windows”
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Example 3 (HIT):
Request URL: https://mydomain.b-cdn.net/thirdurl_img_rsz__1100x1100?alt=media&token=6dc927e1-f479-4a31-8b73-334fb913fd51
Request Method: GET
Status Code: 200
Referrer Policy: strict-origin-when-cross-origin
accept-ranges: bytes
alt-svc: h3=”:443″; ma=2592000
alt-svc: h3-29=”:443″; ma=2592000
cache-control: public, max-age=31919000
cdn-cache: HIT
cdn-cachedat: 01/31/2023 10:30:32
cdn-edgestorageid: 1048
cdn-proxyver: 1.03
cdn-pullzone: 1026160
cdn-requestcountrycode: DE
cdn-requestid: a23d456cf1c633a8f3b86e307fd0927b
cdn-requestpullcode: 206
cdn-requestpullsuccess: True
cdn-status: 200
cdn-storagebalancer: DE-51
cdn-uid: 67d0c44a-c5bc-467b-a61a-63c913093a43
content-disposition: inline; filename*=utf-8”img_rsz__1100x1100
content-length: 101786
content-type: image/jpeg
date: Tue, 31 Jan 2023 15:02:03 GMT
last-modified: Sat, 07 Jan 2023 18:08:32 GMT
perma-cache: MISS
server: BunnyCDN-DE1-1076
x-goog-generation: 1673114912382132
x-goog-hash: crc32c=M/B3Kg==
x-goog-hash: md5=lESJex2dVD9fBcel9BtG9A==
x-goog-meta-firebasestoragedownloadtokens: 6dc927e1-f479-4a31-8b73-334fb913fd51
x-goog-meta-resizedimage: true
x-goog-metageneration: 1
x-goog-storage-class: STANDARD
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 101786
x-guploader-uploadid: ADPycduJDwgnRH_SsGlPZ60m–2Nw_pKDzrGluWXgjr1mzyPS1ERmpXyKi8rGSsGRD26j7AJh70ptGLI522q7qk8dWyxA_0gxJIn
:authority: mydomain.b-cdn.net
:method: GET
:path: /thirdurl_img_rsz__1100x1100?alt=media&token=6dc927e1-f479-4a31-8b73-334fb913fd51
:scheme: https
accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,so;q=0.6
sec-ch-ua: “Not_A Brand”;v=”99″, “Google Chrome”;v=”109″, “Chromium”;v=”109″
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: “Windows”
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Example 4 (MISS):
Request URL: https://mydomain.b-cdn.net/fourthurl?alt=media&token=b691ca7d-8866-4343-9678-fcf93ad210e3
Request Method: GET
Status Code: 200 (from disk cache)
Referrer Policy: strict-origin-when-cross-origin
accept-ranges: bytes
cache-control: public, max-age=31919000
cdn-cache: MISS
cdn-cachedat: 01/31/2023 15:01:03
cdn-edgestorageid: 756
cdn-fileserver: 550
cdn-proxyver: 1.03
cdn-pullzone: 1026160
cdn-requestcountrycode: DE
cdn-requestid: 11dcd4a397661b285a9c15d215a16e9d
cdn-requestpullcode: 206
cdn-requestpullsuccess: True
cdn-status: 200
cdn-storageserver: DE-199
cdn-uid: 67d0c44a-c5bc-467b-a61a-63c913093a43
content-length: 5445
content-type: image/jpeg
date: Tue, 31 Jan 2023 15:01:03 GMT
last-modified: Mon, 30 Jan 2023 12:43:51 GMT
perma-cache: HIT
server: BunnyCDN-DE1-1076
I can send more examples if needed. Thank you very very much!
View Reddit by trolleid – View Source