Getting incorrect cached copies

Hi,

I am seeing major caching issues with my website. I have a single script.js file which is accessed at fast-checkout.cartylabs-api.com/script.js

The content of this file is different based on the URL parameters that I pass in this. For example,

script.js?ts=123123123123&shop=foo.myshopify.com is different from script.js?ts=123123123123&shop=bar.myshopify.com

But I notice that after migrating to Cloudflare, I am seeing that a lot of users are seeing the same script even though their query parameters are different. I set the header Cache-Control: max-age=31556952 which is one year.

I am pasting 2 request and response headers. The first one is showing incorrect data. The second one shows correct data:

Incorrect data :

**Request URL: https://fast-checkout.cartylabs.com/api/script.js?ts=1621050811133&shop=sinnlos-aber-geil.myshopify.com**
**Request Method: GET**
**Status Code: 200 (from disk cache)**
**Remote Address: [2606:4700:3035::ac43:d9b3]:443**
**Referrer Policy: strict-origin-when-cross-origin**
**age: 253574**
**alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400**
**cache-control: max-age=31556952**
**cf-cache-status: DYNAMIC**
**cf-ray: 64f97c648c9407ff-ATL**
**cf-request-id: 0a0fcc12d8000007ff8ea0d000000001**
**content-encoding: br**
**content-type: text/javascript**
**date: Sat, 15 May 2021 04:05:05 GMT**
**expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"**
**nel: {"report_to":"cf-nel","max_age":604800}**
**report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=2mEV0mNZY2L5g51tHpmUDhCypk9ANBn9FbC8s1EmPDS7EAKIMLkzR%2BMopAzJKQD%2BPCugeiyALheRMPkBe7M4zQVLY%2BkyJ2wSGqTQNJ18VuVUxoJvYx1fdv9Y5qoGessOTMEZ4rHB3fVy7b7b"}],"group":"cf-nel","max_age":604800}**
**server: cloudflare**
**x-amz-apigw-id: fM18zF3AoAMFtKQ=**
**x-amzn-requestid: c810e3c1-6f26-4363-9733-40be0ae4f566**
**x-amzn-trace-id: Root=1-609b69eb-31e8dbba4de74da1129c585d;Sampled=0**
**x-nf-request-id: 04d052b0-5e98-4607-8b82-2eb090bd898f**
**Provisional headers are shown. Disable cache to see full headers.**
**Referer: https://sinnlosabergeil.de/**
**sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"**
**sec-ch-ua-mobile: ?0**
**User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36**
**ts: 1621050811133**
**shop: sinnlos-aber-geil.myshopify.com**

Correct data:

<strong>Request URL: https://fast-checkout.cartylabs.com/api/script.js?ts=1621050811133&shop=sinnlos-aber-geil.myshopify.com
Request Method: GET
Status Code: 200 (from memory cache)
Remote Address: [2606:4700:3035::6815:460e]:443
Referrer Policy: strict-origin-when-cross-origin
age: 0
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
cache-control: max-age=31556952
cf-cache-status: DYNAMIC
cf-ray: 64f97cd74ccff345-ATL
cf-request-id: 0a0fcc5a880000f34589a1f000000001
content-encoding: br
content-type: text/javascript
date: Sat, 15 May 2021 04:05:23 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
nel: {"report_to":"cf-nel","max_age":604800}
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=cnHp1BtR98CrYIJeSyxmTsn5lVrwcL8CsISTxgyoTb11luclclMVvwy9LAhf9ZpSnqAE3wN08kX9oEWtaynOELzdUBzdwEZljvIzwtoddVa%2FQwKvI48I6MRVX9DTTN%2FR0xmmzI233xPUqt5B"}],"group":"cf-nel","max_age":604800}
server: cloudflare
x-amz-apigw-id: fWhEmFIaoAMFzXA=
x-amzn-requestid: c0ff3e83-df69-4735-945f-ef012cff6ed3
x-amzn-trace-id: Root=1-609f4883-46b047ac496ebc90638c128d;Sampled=0
x-nf-request-id: 3a1f400f-c3f3-476a-8021-418846a6fe05
Provisional headers are shown. Disable cache to see full headers.
Referer: https://sinnlosabergeil.de/
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
ts: 1621050811133
shop: sinnlos-aber-geil.myshopify.com</strong>

I am hoping that someone can help me out with this since a lot of my customers are seeing totally incorrect information, and sometimes information from other customers.

Thanks in advance.

I am afraid that will be primarily a question for your service provider. That hostname goes straight to Netlify and they manage that. They do seem to use Cloudflare as well, but no caching on Cloudflare’s side would take place in this case.

Thank you for the reply. How can we conclude that the caching is not happening at Cloudfare side? I have been facing these issues only after I have migrated to Cloudflare. I have been using Netlify all through out for almost 1 year without any issues. Thanks

@sdayman Hi,

Please can you help with this issue?

The DNS issue is somehow solved. But I am seeing major caching issues with my website. I have a single script.js file which is accessed at fast-checkout.cartylabs-api.com/script.js

The content of this file is different based on the URL parameters that I pass in this. For example,

script.js?ts=123123123123&shop=foo.myshopify.com is different from script.js?ts=123123123123&shop=bar.myshopify.com

But I notice that after migrating to Cloudflare, I am seeing that a lot of users are seeing the same script even though their query parameters are different. I set the header Cache-Control: max-age=31556952 which is one year.

I am pasting 2 request and response headers. The first one is showing incorrect data. The second one shows correct data:

Incorrect data :

Request URL: https://fast-checkout.cartylabs.com/api/script.js?ts=1621050811133&shop=sinnlos-aber-geil.myshopify.com
Request Method: GET
Status Code: 200 (from disk cache)
Remote Address: [2606:4700:3035::ac43:d9b3]:443
Referrer Policy: strict-origin-when-cross-origin
age: 253574
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
cache-control: max-age=31556952
cf-cache-status: DYNAMIC
cf-ray: 64f97c648c9407ff-ATL
cf-request-id: 0a0fcc12d8000007ff8ea0d000000001
content-encoding: br
content-type: text/javascript
date: Sat, 15 May 2021 04:05:05 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
nel: {“report_to”:“cf-nel”,“max_age”:604800}
report-to: {“endpoints”:[{“url”:“https://a.nel.cloudflare.com/report?s=2mEV0mNZY2L5g51tHpmUDhCypk9ANBn9FbC8s1EmPDS7EAKIMLkzR%2BMopAzJKQD%2BPCugeiyALheRMPkBe7M4zQVLY%2BkyJ2wSGqTQNJ18VuVUxoJvYx1fdv9Y5qoGessOTMEZ4rHB3fVy7b7b"}],“group”:“cf-nel”,"max_age”:604800}
server: cloudflare
x-amz-apigw-id: fM18zF3AoAMFtKQ=
x-amzn-requestid: c810e3c1-6f26-4363-9733-40be0ae4f566
x-amzn-trace-id: Root=1-609b69eb-31e8dbba4de74da1129c585d;Sampled=0
x-nf-request-id: 04d052b0-5e98-4607-8b82-2eb090bd898f
Provisional headers are shown. Disable cache to see full headers.
Referer: https://sinnlosabergeil.de/
sec-ch-ua: " Not A;Brand";v=“99”, “Chromium”;v=“90”, “Google Chrome”;v="90"
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
ts: 1621050811133
shop: sinnlos-aber-geil.myshopify.com

Correct data:

Request URL: https://fast-checkout.cartylabs.com/api/script.js?ts=1621050811133&shop=sinnlos-aber-geil.myshopify.com
Request Method: GET
Status Code: 200 (from memory cache)
Remote Address: [2606:4700:3035::6815:460e]:443
Referrer Policy: strict-origin-when-cross-origin
age: 0
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
cache-control: max-age=31556952
cf-cache-status: DYNAMIC
cf-ray: 64f97cd74ccff345-ATL
cf-request-id: 0a0fcc5a880000f34589a1f000000001
content-encoding: br
content-type: text/javascript
date: Sat, 15 May 2021 04:05:23 GMT
expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct
nel: {“report_to”:“cf-nel”,“max_age”:604800}
report-to: {“endpoints”:[{“url”:“https://a.nel.cloudflare.com/report?s=cnHp1BtR98CrYIJeSyxmTsn5lVrwcL8CsISTxgyoTb11luclclMVvwy9LAhf9ZpSnqAE3wN08kX9oEWtaynOELzdUBzdwEZljvIzwtoddVa%2FQwKvI48I6MRVX9DTTN%2FR0xmmzI233xPUqt5B"}],“group”:“cf-nel”,"max_age”:604800}
server: cloudflare
x-amz-apigw-id: fWhEmFIaoAMFzXA=
x-amzn-requestid: c0ff3e83-df69-4735-945f-ef012cff6ed3
x-amzn-trace-id: Root=1-609f4883-46b047ac496ebc90638c128d;Sampled=0
x-nf-request-id: 3a1f400f-c3f3-476a-8021-418846a6fe05
Provisional headers are shown. Disable cache to see full headers.
Referer: https://sinnlosabergeil.de/
sec-ch-ua: " Not A;Brand";v=“99”, “Chromium”;v=“90”, “Google Chrome”;v=“90”
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
ts: 1621050811133
shop: sinnlos-aber-geil.myshopify.com

A lot of my customers are complaining about this and I would really appreciate it if you can give me a quick answer about this. I

That hostname does not go through your Cloudflare account in the first place. Cloudflare only comes in on your host’s side

nslookup fast-checkout.cartylabs.com
Server:  one.one.one.one
Address:  1.1.1.1

Non-authoritative answer:
Name:    agitated-wescoff-6bd242.netlify.app
Addresses:  2a03:b0c0:3:d0::d24:2001
          2a03:b0c0:3:d0::d26:4001
          18.192.76.182
          206.189.58.26
Aliases:  fast-checkout.cartylabs.com

Plus the mentioned caching status clearly shows that Cloudflare does not cache anything. You really best contact your host/provider to clarify that as they manage that Cloudflare integration, but the issue is most likely not there anyhow but rather on their side.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.