So it looks like the cache is re-fetching the files from your origin server.
I would try adding a page rule which does sets Cache Everything, and a sufficiently long Edge Cache TTL:
The CF free plan should be extremely fast (if it serves cached data and does not attempt to revalidate).
I’ve re-checked the header of those requests and found that only the first one has cf-cache-status: REVALIDATED. All other requests has cf-cache-status: HIT. And the response time still is the same.
So I think it is not the reason for my problem. I will update my question to change the cf-cache-status to match the major number of requests.
Looking at your numbers, something very strange is happening.
Hits should be super-fast.
Have a look at https://speed.cloudflare.com/
This will show you which Cloudflare cache you are hitting,
and the latency number in the top right will show you the round trip time from your browser to the cache. The response time for cached http requests should be roughly this number, + payload serialisation time (payload size/your bandwidth) + a small overhead.
My Latency is 42.7 ms and the server location is HKG. But when I check on https://shopdunk.com/cdn-cgi/trace the actual server is SIN. I don’t know what to do next with this information.
The strange here is both my CF data center and my origin server is located in Singapore but their response time is deeply different.
I have checked my request with cURL and found that Cloudflare is simply slow. Maybe it helps. Here is the result:
Non-proxy request:
Time Handshake: 0.132179
Time Connect: 0.038150
Name Lookup Time: 0.001735
Time Pretransfer: 0.132716
Time Redirect: 0.000000
Time Start Transfer: 0.176743
Time Total: 0.246519
Cached request withcf-cache-status: HIT:
Time Handshake: 0.843496
Time Connect: 0.111792
Name Lookup Time: 0.001541
Time Pretransfer: 0.843791
Time Redirect: 0.000000
Time Start Transfer: 0.964540
Time Total: 1.305000
After 2 weeks of exchanging email support, the Cloudflare staff admit that the problem may come from CPU overload from HKG datacenters. They are working on it to make things better.
I can see the load time is better but still slower than the uncached request timing. The only thing we can do now is waiting for them to completely fix the problem.