Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full_bin_index.7dbe22a9 frequent loading failed #1418

Open
hurrykee opened this issue Apr 20, 2024 · 4 comments
Open

full_bin_index.7dbe22a9 frequent loading failed #1418

hurrykee opened this issue Apr 20, 2024 · 4 comments
Labels

Comments

@hurrykee
Copy link

The visit area is outside the United States, such as the Chinese mainland, Vietnam, Malaysia.

full_bin_index.7dbe22a9 file is relatively large, in the loading process, very vulnerable to the impact of the network environment, resulting in loading failed.

  1. Expect SDK to add support and customize proxy transit?
  2. Expect SDK to support customized cache valid period?

Or is there another better solution?

WX20240420-171613
WX20240420-171631

@Nemikolh
Copy link
Member

Hey @hurrykee! 👋 Thanks for the report!

I think we could definitely retry to fetch those resources if they failed to load at a minimum 👍

In terms of proxying, we use Cloudflare and here it responded with CF-Cache-Status: DYNAMIC which means that it was in its cache. They have data centers in all the locations you mentioned. Looking at the status page it also seems that their datacenter in Vietnam is being re-routed but not for China nor Malaysia at this time.

Could you run:

curl -vv https://w-corp-staticblitz.com/cdn-cgi/trace

and share what you get for colo ? This will tell us which data center you're being connected to. Maybe there's something strange happening there.

Regarding caching, this resource, full_bin_index.7dbe22a9 is cached for a year (as you can see by the Cache-Control header) but it is dependent on the webcontainer version which is updated frequently. We've been talking about improvement on that front.

@hurrykee
Copy link
Author

hurrykee commented Apr 20, 2024

Thanks for the reply:
At present, Guangdong Province in the Chinese mainland has repeatedly requested the resource, but it is still timed out and cannot successfully obtain it completely.
The caching time of the CDN is 1 year, I have learned.
I'm sorry I didn't make my request clear.
What I expect is whether the SDK can support setting the cache time of a local browser. During this valid period, the network is not requested repeatedly, or the network is requested less. In order to avoid service instability due to network problems.
Even more, I expect that the relevant basic resources can be directly integrated into the local project. Developers regularly update these resources locally according to official updates.

image

image

*   Trying 198.18.218.164...
* TCP_NODELAY set
* Connected to w-corp-staticblitz.com (198.18.218.164) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=w-corp-staticblitz.com
*  start date: Apr 13 00:42:33 2024 GMT
*  expire date: Jul 12 00:42:32 2024 GMT
*  subjectAltName: host "w-corp-staticblitz.com" matched cert's "w-corp-staticblitz.com"
*  issuer: C=US; O=Let's Encrypt; CN=E1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f8da300dc00)
> GET /cdn-cgi/trace HTTP/2
> Host: w-corp-staticblitz.com
> User-Agent: curl/7.64.1
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200 
< date: Sat, 20 Apr 2024 10:02:49 GMT
< content-type: text/plain
< access-control-allow-origin: *
< server: cloudflare
< cf-ray: 87744d0cafa7dc67-LHR
< x-frame-options: DENY
< x-content-type-options: nosniff
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< cache-control: no-cache
< 
fl=378f21
h=w-corp-staticblitz.com
ip=119.***.***.202
ts=1713607369.71
visit_scheme=https
uag=curl/7.64.1
colo=LHR
sliver=010-tier1
http=http/2
loc=CN
tls=TLSv1.2
sni=plaintext
warp=off
gateway=off
rbi=off
kex=X25519
* Connection #0 to host w-corp-staticblitz.com left intact
* Closing connection 0

@Nemikolh
Copy link
Member

Woo it looks like you're being routed to the LHR data center which is based in london! 🤯

That sounds like our main issue here.

Thanks for the info! 😃

What I expect is whether the SDK can support setting the cache time of a local browser. During this valid period, the network is not requested repeatedly, or the network is requested less. In order to avoid service instability due to network problems.

The fact that resources are fetched again means that you don't have them in your local cache. All resources have a Cache-Control set to maximize the use of your local cache.

Note that if your cache is used, the resources will still appear in the network tab of the devtools but it will be served from your cache.

image

I think the issue here is that you can't even get it in the first place?

@hurrykee
Copy link
Author

The disk cache does take effect after the initial request is successful. But it is still very unstable.

Although the webcontainer version is updated frequently, in the actual production environment, we expect more stability.

So, why not package these resources into a project that uses webcontainers? This way, you can make full use of the local network and closer CDN nodes.

Of course, hypothesis we can configuration customized proxy server in the SDK, we can choose a better quality and local conditions of CDN acceleration line. Compared to Cloudflare this speed will be faster, the failure rate will be lower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants